diff --git a/Cargo.lock b/Cargo.lock index 93452e8e..3087ea3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -945,9 +945,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.52.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ "windows-core", "windows-targets", @@ -955,9 +955,43 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.52.0" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" dependencies = [ "windows-targets", ] diff --git a/crates/wdk-build/Cargo.toml b/crates/wdk-build/Cargo.toml index cc8bfafb..9f77a645 100644 --- a/crates/wdk-build/Cargo.toml +++ b/crates/wdk-build/Cargo.toml @@ -16,7 +16,7 @@ serde_json.workspace = true clap = { version = "4.5.4", features = ["derive"] } clap-cargo = "0.14.0" thiserror = "1.0.59" -windows = { version = "0.52.0", features = [ +windows = { version = "0.56.0", features = [ "Win32_Foundation", "Win32_System_Registry", ] } @@ -26,7 +26,7 @@ cargo_metadata = "0.18.1" rustversion = "1.0.15" [dev-dependencies] -windows = { version = "0.52.0", features = ["Win32_UI_Shell"] } +windows = { version = "0.56.0", features = ["Win32_UI_Shell"] } # Cannot inherit workspace lints since overriding them is not supported yet: https://github.com/rust-lang/cargo/issues/13157 # [lints] diff --git a/crates/wdk-build/src/utils.rs b/crates/wdk-build/src/utils.rs index bc9a3150..accebc67 100644 --- a/crates/wdk-build/src/utils.rs +++ b/crates/wdk-build/src/utils.rs @@ -217,6 +217,7 @@ fn read_registry_key_string_value( // SAFETY: `opened_key_handle` is valid opened key that was opened by // `RegOpenKeyExA` unsafe { RegCloseKey(opened_key_handle) } + .ok() .expect("opened_key_handle should be successfully closed"); return Some( CStr::from_bytes_with_nul(&buffer[..len as usize]) @@ -235,7 +236,8 @@ fn read_registry_key_string_value( // SAFETY: `opened_key_handle` is valid opened key that was opened by // `RegOpenKeyExA` unsafe { RegCloseKey(opened_key_handle) } - .expect(r"opened_key_handle should be successfully closed"); + .ok() + .expect("opened_key_handle should be successfully closed"); } None }