diff --git a/Cargo.lock b/Cargo.lock index 156440f1..7f5faefd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -898,7 +898,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1123,9 +1123,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" +checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de" dependencies = [ "rustix", "windows-sys 0.52.0", diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 00ffe458..03399ae8 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -27,7 +27,7 @@ tracing = ["dep:tracing"] cli-logging = ["tracing", "dep:tracing-subscriber"] [target.'cfg(target_os = "windows")'.dependencies] -windows-sys = { version = "0.52.0", features = [ +windows-sys = { version = "0.59.0", features = [ "Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation", diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index 5e4fe447..5bb397cb 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,6 +1,6 @@ use std::mem; use windows_sys::Win32::{ - Foundation::{FreeLibrary, HMODULE, S_OK}, + Foundation::{HMODULE, S_OK}, System::{ LibraryLoader::{GetProcAddress, LoadLibraryA}, SystemInformation::{ @@ -16,7 +16,7 @@ struct LibraryHandle(HMODULE); impl LibraryHandle { fn new(name: &[u8]) -> Option { let handle = unsafe { LoadLibraryA(name.as_ptr() as _) }; - (handle != 0).then(|| Self(handle)) + (!handle.is_null()).then_some(Self(handle)) } /// Get a function pointer to a function in the library. @@ -33,12 +33,6 @@ impl LibraryHandle { } } -impl Drop for LibraryHandle { - fn drop(&mut self) { - unsafe { FreeLibrary(self.0) }; - } -} - type GetMachineTypeAttributesFuncType = unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32; const _: () = { diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 00be6e48..bd7ed3c9 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.8.1" +fs4 = "0.9.1" diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index af209ff5..0a96609f 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -8,7 +8,7 @@ use std::{ ops, }; -use fs4::FileExt; +use fs4::fs_std::FileExt; /// A locked file. #[derive(Debug)]