Skip to content

Commit

Permalink
build: upgrade windows-sys 0.52 → 0.59
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jan 22, 2025
1 parent 30f46a8 commit cfffed3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mach = "0.3"
libc = "0.2"

[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
version = "0.52"
version = "0.59"
features = [
"Win32_Foundation",
"Win32_System_LibraryLoader",
Expand Down
7 changes: 5 additions & 2 deletions src/rt_win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ mod avrt_lib {
let task_handle = unsafe {
(self.av_set_mm_thread_characteristics_w)(task_name, &mut mmcss_task_index)
};
win32_error_if(task_handle == 0)?;
win32_error_if(task_handle.is_null())?;
Ok((mmcss_task_index, task_handle))
}

Expand Down Expand Up @@ -174,7 +174,7 @@ mod win32_utils {
impl OwnedLibrary {
pub(super) fn try_new(lib_file_name: PCWSTR) -> Result<Self, WIN32_ERROR> {
let module = unsafe { LoadLibraryW(lib_file_name) };
win32_error_if(module == 0)?;
win32_error_if(module.is_null())?;
Ok(Self(module))
}

Expand All @@ -201,6 +201,9 @@ mod win32_utils {
}
}
}

unsafe impl Send for OwnedLibrary {}
unsafe impl Sync for OwnedLibrary {}
}

#[cfg(test)]
Expand Down

0 comments on commit cfffed3

Please sign in to comment.