Skip to content

Commit

Permalink
Upgrade windows-sys to version 0.59 (and MSRV to 1.60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive authored and gentoo90 committed Jan 12, 2025
1 parent 4574feb commit f044074
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- channel: stable
target: x86_64-pc-windows-msvc
lint: true
- channel: '1.56'
- channel: '1.60'
target: x86_64-pc-windows-msvc
restrict_deps_versions: true
env:
Expand All @@ -47,18 +47,36 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Restrict serde version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
with:
command: update
args: --package serde --precise 1.0.210
- name: Restrict syn version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
with:
command: update
args: --package syn --precise 2.0.67
- name: Restrict chrono version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
with:
command: update
args: --package chrono --precise 0.4.26
args: --package chrono --precise 0.4.31
- name: Restrict libc version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
with:
command: update
args: --package libc --precise 0.2.163
- name: Restrict memchr version
if: matrix.restrict_deps_versions
uses: actions-rs/cargo@v1
with:
command: update
args: --package memchr --precise 2.6.2
- name: Setup Taplo
if: matrix.lint
uses: uncenter/setup-taplo@v1
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "winreg"
edition = "2021"
rust-version = "1.56"
rust-version = "1.60"
version = "0.54.0"
authors = ["Igor Shaula <[email protected]>"]
license = "MIT"
Expand All @@ -14,7 +14,7 @@ categories = ["api-bindings", "os::windows-apis"]

[dependencies]
cfg-if = "1.0"
windows-sys = { version = "0.52", features = [
windows-sys = { version = "0.59", features = [
"Win32_Foundation",
"Win32_System_Time",
"Win32_System_Registry",
Expand Down
10 changes: 5 additions & 5 deletions src/reg_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl RegKey {
options: u32,
) -> io::Result<RegKey> {
let c_filename = to_utf16(filename);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
match unsafe {
Registry::RegLoadAppKeyW(c_filename.as_ptr(), &mut new_hkey, perms, options, 0)
} {
Expand Down Expand Up @@ -191,7 +191,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<RegKey> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
match unsafe {
Registry::RegOpenKeyExW(self.hkey, c_path.as_ptr(), options, perms, &mut new_hkey)
} {
Expand Down Expand Up @@ -231,7 +231,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<RegKey> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
match unsafe {
Registry::RegOpenKeyTransactedW(
self.hkey,
Expand Down Expand Up @@ -292,7 +292,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<(RegKey, RegDisposition)> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
let mut disp_buf: u32 = 0;
match unsafe {
Registry::RegCreateKeyExW(
Expand Down Expand Up @@ -346,7 +346,7 @@ impl RegKey {
perms: Registry::REG_SAM_FLAGS,
) -> io::Result<(RegKey, RegDisposition)> {
let c_path = to_utf16(path);
let mut new_hkey: HKEY = 0;
let mut new_hkey: HKEY = std::ptr::null_mut();
let mut disp_buf: u32 = 0;
match unsafe {
Registry::RegCreateKeyTransactedW(
Expand Down

0 comments on commit f044074

Please sign in to comment.