Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update windows-sys. #1820

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ libc = "0.2.149"
libc = { package = "hermit-abi", version = "0.3.9" }

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52"
version = "0.59"
features = [
"Wdk_Foundation", # Required for AFD.
"Wdk_Storage_FileSystem", # Required for AFD.
Expand Down
4 changes: 2 additions & 2 deletions src/sys/windows/afd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Afd {
(*iosb).Anonymous.Status = STATUS_PENDING;
let status = NtDeviceIoControlFile(
self.fd.as_raw_handle() as HANDLE,
0,
std::ptr::null_mut(),
None,
overlapped,
iosb,
Expand Down Expand Up @@ -131,7 +131,7 @@ cfg_io_source! {

const AFD_HELPER_ATTRIBUTES: OBJECT_ATTRIBUTES = OBJECT_ATTRIBUTES {
Length: size_of::<OBJECT_ATTRIBUTES>() as u32,
RootDirectory: 0,
RootDirectory: null_mut(),
ObjectName: &AFD_OBJ_NAME as *const _ as *mut _,
Attributes: 0,
SecurityDescriptor: null_mut(),
Expand Down
9 changes: 5 additions & 4 deletions src/sys/windows/iocp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::fmt;
use std::io;
use std::mem;
use std::os::windows::io::*;
use std::ptr::null_mut;
use std::time::Duration;

use windows_sys::Win32::Foundation::{HANDLE, INVALID_HANDLE_VALUE};
Expand Down Expand Up @@ -45,8 +46,8 @@ impl CompletionPort {
/// allowed for threads associated with this port. Consult the Windows
/// documentation for more information about this value.
pub fn new(threads: u32) -> io::Result<CompletionPort> {
let ret = unsafe { CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, threads) };
if ret == 0 {
let ret = unsafe { CreateIoCompletionPort(INVALID_HANDLE_VALUE, null_mut(), 0, threads) };
if ret == null_mut() {
Err(io::Error::last_os_error())
} else {
Ok(CompletionPort {
Expand All @@ -69,7 +70,7 @@ impl CompletionPort {
let ret = unsafe {
CreateIoCompletionPort(t.as_raw_handle() as HANDLE, self.handle.raw(), token, 0)
};
if ret == 0 {
if ret == null_mut() {
Err(io::Error::last_os_error())
} else {
Ok(())
Expand Down Expand Up @@ -191,7 +192,7 @@ impl CompletionStatus {
/// This function is useful when creating a stack buffer or vector of
/// completion statuses to be passed to the `get_many` function.
pub fn zero() -> Self {
Self::new(0, 0, std::ptr::null_mut())
Self::new(0, 0, null_mut())
}

/// Returns the number of bytes that were transferred for the I/O operation
Expand Down
Loading