Skip to content

Commit f044074

Browse files
ssrlivegentoo90
authored andcommitted
Upgrade windows-sys to version 0.59 (and MSRV to 1.60)
1 parent 4574feb commit f044074

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- channel: stable
2121
target: x86_64-pc-windows-msvc
2222
lint: true
23-
- channel: '1.56'
23+
- channel: '1.60'
2424
target: x86_64-pc-windows-msvc
2525
restrict_deps_versions: true
2626
env:
@@ -47,18 +47,36 @@ jobs:
4747
uses: actions-rs/cargo@v1
4848
with:
4949
command: generate-lockfile
50+
- name: Restrict serde version
51+
if: matrix.restrict_deps_versions
52+
uses: actions-rs/cargo@v1
53+
with:
54+
command: update
55+
args: --package serde --precise 1.0.210
56+
- name: Restrict syn version
57+
if: matrix.restrict_deps_versions
58+
uses: actions-rs/cargo@v1
59+
with:
60+
command: update
61+
args: --package syn --precise 2.0.67
5062
- name: Restrict chrono version
5163
if: matrix.restrict_deps_versions
5264
uses: actions-rs/cargo@v1
5365
with:
5466
command: update
55-
args: --package chrono --precise 0.4.26
67+
args: --package chrono --precise 0.4.31
5668
- name: Restrict libc version
5769
if: matrix.restrict_deps_versions
5870
uses: actions-rs/cargo@v1
5971
with:
6072
command: update
6173
args: --package libc --precise 0.2.163
74+
- name: Restrict memchr version
75+
if: matrix.restrict_deps_versions
76+
uses: actions-rs/cargo@v1
77+
with:
78+
command: update
79+
args: --package memchr --precise 2.6.2
6280
- name: Setup Taplo
6381
if: matrix.lint
6482
uses: uncenter/setup-taplo@v1

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "winreg"
33
edition = "2021"
4-
rust-version = "1.56"
4+
rust-version = "1.60"
55
version = "0.54.0"
66
authors = ["Igor Shaula <[email protected]>"]
77
license = "MIT"
@@ -14,7 +14,7 @@ categories = ["api-bindings", "os::windows-apis"]
1414

1515
[dependencies]
1616
cfg-if = "1.0"
17-
windows-sys = { version = "0.52", features = [
17+
windows-sys = { version = "0.59", features = [
1818
"Win32_Foundation",
1919
"Win32_System_Time",
2020
"Win32_System_Registry",

src/reg_key.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl RegKey {
9797
options: u32,
9898
) -> io::Result<RegKey> {
9999
let c_filename = to_utf16(filename);
100-
let mut new_hkey: HKEY = 0;
100+
let mut new_hkey: HKEY = std::ptr::null_mut();
101101
match unsafe {
102102
Registry::RegLoadAppKeyW(c_filename.as_ptr(), &mut new_hkey, perms, options, 0)
103103
} {
@@ -191,7 +191,7 @@ impl RegKey {
191191
perms: Registry::REG_SAM_FLAGS,
192192
) -> io::Result<RegKey> {
193193
let c_path = to_utf16(path);
194-
let mut new_hkey: HKEY = 0;
194+
let mut new_hkey: HKEY = std::ptr::null_mut();
195195
match unsafe {
196196
Registry::RegOpenKeyExW(self.hkey, c_path.as_ptr(), options, perms, &mut new_hkey)
197197
} {
@@ -231,7 +231,7 @@ impl RegKey {
231231
perms: Registry::REG_SAM_FLAGS,
232232
) -> io::Result<RegKey> {
233233
let c_path = to_utf16(path);
234-
let mut new_hkey: HKEY = 0;
234+
let mut new_hkey: HKEY = std::ptr::null_mut();
235235
match unsafe {
236236
Registry::RegOpenKeyTransactedW(
237237
self.hkey,
@@ -292,7 +292,7 @@ impl RegKey {
292292
perms: Registry::REG_SAM_FLAGS,
293293
) -> io::Result<(RegKey, RegDisposition)> {
294294
let c_path = to_utf16(path);
295-
let mut new_hkey: HKEY = 0;
295+
let mut new_hkey: HKEY = std::ptr::null_mut();
296296
let mut disp_buf: u32 = 0;
297297
match unsafe {
298298
Registry::RegCreateKeyExW(
@@ -346,7 +346,7 @@ impl RegKey {
346346
perms: Registry::REG_SAM_FLAGS,
347347
) -> io::Result<(RegKey, RegDisposition)> {
348348
let c_path = to_utf16(path);
349-
let mut new_hkey: HKEY = 0;
349+
let mut new_hkey: HKEY = std::ptr::null_mut();
350350
let mut disp_buf: u32 = 0;
351351
match unsafe {
352352
Registry::RegCreateKeyTransactedW(

0 commit comments

Comments
 (0)