Skip to content

Commit

Permalink
fix mismatched types.
Browse files Browse the repository at this point in the history
  • Loading branch information
westy92 committed Aug 6, 2024
1 parent 88d1c82 commit 7d6e2ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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,
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
6 changes: 3 additions & 3 deletions src/sys/windows/iocp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,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 +69,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

0 comments on commit 7d6e2ed

Please sign in to comment.