diff --git a/examples/Cargo.toml b/examples/Cargo.toml index d11a2380db9..594d2191400 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -25,7 +25,7 @@ httpdate = "1.0" once_cell = "1.5.2" [target.'cfg(windows)'.dev-dependencies.windows-sys] -version = "0.52" +version = "0.59" [[example]] name = "chat" diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 565b5867efd..2ee0fab0d0e 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -123,11 +123,11 @@ libc = { version = "0.2.168" } nix = { version = "0.29.0", default-features = false, features = ["aio", "fs", "socket"] } [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.52" +version = "0.59" optional = true [target.'cfg(windows)'.dev-dependencies.windows-sys] -version = "0.52" +version = "0.59" features = [ "Win32_Foundation", "Win32_Security_Authorization", diff --git a/tokio/src/net/windows/named_pipe.rs b/tokio/src/net/windows/named_pipe.rs index 417e67b31dd..0d51335aea6 100644 --- a/tokio/src/net/windows/named_pipe.rs +++ b/tokio/src/net/windows/named_pipe.rs @@ -7,6 +7,7 @@ use std::ffi::OsStr; use std::io::{self, Read, Write}; use std::pin::Pin; use std::ptr; +use std::ptr::null_mut; use std::task::{Context, Poll}; use crate::io::{AsyncRead, AsyncWrite, Interest, PollEvented, ReadBuf, Ready}; @@ -2556,7 +2557,7 @@ impl ClientOptions { attrs as *mut _, windows_sys::OPEN_EXISTING, self.get_flags(), - 0, + null_mut(), ); if h == windows_sys::INVALID_HANDLE_VALUE { diff --git a/tokio/src/process/windows.rs b/tokio/src/process/windows.rs index debd8567d04..c49df36b114 100644 --- a/tokio/src/process/windows.rs +++ b/tokio/src/process/windows.rs @@ -28,6 +28,7 @@ use std::os::windows::prelude::{AsRawHandle, IntoRawHandle, OwnedHandle, RawHand use std::pin::Pin; use std::process::Stdio; use std::process::{Child as StdChild, ExitStatus}; +use std::ptr::null_mut; use std::sync::Arc; use std::task::{Context, Poll}; @@ -119,7 +120,7 @@ impl Future for Child { } let (tx, rx) = oneshot::channel(); let ptr = Box::into_raw(Box::new(Some(tx))); - let mut wait_object = 0; + let mut wait_object = null_mut(); let rc = unsafe { RegisterWaitForSingleObject( &mut wait_object,