1
Fork 0

windows bump to 0.52

This commit is contained in:
klensy 2024-02-18 16:02:16 +03:00
parent 5e2a7ac47a
commit 35fe26757a
11 changed files with 16 additions and 17 deletions

View file

@ -6176,11 +6176,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "windows" name = "windows"
version = "0.48.0" version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [ dependencies = [
"windows-targets 0.48.5", "windows-core",
"windows-targets 0.52.0",
] ]
[[package]] [[package]]

View file

@ -51,5 +51,5 @@ default-features = false
features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write"] features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write"]
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.52.0"
features = ["Win32_Globalization"] features = ["Win32_Globalization"]

View file

@ -33,7 +33,7 @@ tracing = "0.1"
version = "0.12" version = "0.12"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.52.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_Storage_FileSystem", "Win32_Storage_FileSystem",

View file

@ -69,7 +69,6 @@ impl Lock {
&mut overlapped, &mut overlapped,
) )
} }
.ok()
.map_err(|e| { .map_err(|e| {
let err = io::Error::from_raw_os_error(e.code().0); let err = io::Error::from_raw_os_error(e.code().0);
debug!("failed acquiring file lock: {}", err); debug!("failed acquiring file lock: {}", err);

View file

@ -866,16 +866,14 @@ cfg_match! {
use std::mem; use std::mem;
use windows::{ use windows::{
// FIXME: change back to K32GetProcessMemoryInfo when windows crate Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
// updated to 0.49.0+ to drop dependency on psapi.dll
Win32::System::ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
Win32::System::Threading::GetCurrentProcess, Win32::System::Threading::GetCurrentProcess,
}; };
let mut pmc = PROCESS_MEMORY_COUNTERS::default(); let mut pmc = PROCESS_MEMORY_COUNTERS::default();
let pmc_size = mem::size_of_val(&pmc); let pmc_size = mem::size_of_val(&pmc);
unsafe { unsafe {
GetProcessMemoryInfo( K32GetProcessMemoryInfo(
GetCurrentProcess(), GetCurrentProcess(),
&mut pmc, &mut pmc,
pmc_size as u32, pmc_size as u32,

View file

@ -60,7 +60,7 @@ libc = "0.2"
# tidy-alphabetical-end # tidy-alphabetical-end
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.52.0"
features = [ features = [
"Win32_System_Diagnostics_Debug", "Win32_System_Diagnostics_Debug",
] ]

View file

@ -30,7 +30,7 @@ unicode-width = "0.1.4"
# tidy-alphabetical-end # tidy-alphabetical-end
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.52.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_Security", "Win32_Security",

View file

@ -27,7 +27,8 @@ pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
impl Drop for Handle { impl Drop for Handle {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
CloseHandle(self.0); // FIXME can panic here
CloseHandle(self.0).unwrap();
} }
} }
} }
@ -37,7 +38,8 @@ pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
impl Drop for Guard { impl Drop for Guard {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
ReleaseMutex((self.0).0); // FIXME can panic here
ReleaseMutex((self.0).0).unwrap();
} }
} }
} }

View file

@ -30,7 +30,7 @@ libc = "0.2"
# tidy-alphabetical-end # tidy-alphabetical-end
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.52.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_System_LibraryLoader", "Win32_System_LibraryLoader",

View file

@ -143,7 +143,6 @@ fn current_dll_path() -> Result<PathBuf, String> {
&mut module, &mut module,
) )
} }
.ok()
.map_err(|e| e.to_string())?; .map_err(|e| e.to_string())?;
let mut filename = vec![0; 1024]; let mut filename = vec![0; 1024];

View file

@ -34,7 +34,7 @@ libc = "0.2"
miow = "0.6" miow = "0.6"
[target.'cfg(windows)'.dependencies.windows] [target.'cfg(windows)'.dependencies.windows]
version = "0.48.0" version = "0.52.0"
features = [ features = [
"Win32_Foundation", "Win32_Foundation",
"Win32_System_Diagnostics_Debug", "Win32_System_Diagnostics_Debug",