From 0f123e39cabb358a435837548d274d82f31ea1b2 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Tue, 21 Jan 2025 20:43:28 -0500 Subject: [PATCH] =?UTF-8?q?build:=20upgrade=20`windows-sys`=200.52=20?= =?UTF-8?q?=E2=86=92=200.59?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 7 +++++++ examples/Cargo.toml | 2 +- tokio/Cargo.toml | 2 +- tokio/src/net/windows/named_pipe.rs | 3 ++- tokio/src/process/windows.rs | 3 ++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2238deac71c..52e0ba0d8c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,3 +17,10 @@ members = [ [workspace.metadata.spellcheck] config = "spellcheck.toml" + + +[patch.crates-io] +# TODO: Consume a release of `mio` that contains . +mio = { git = "https://github.com/erichdongubler-contrib/mio", rev = "1ef9c035f9c147621a6aa1d7b80a14d7acb09555" } +# TODO: Consume a release of `socket2` that contains . +socket2 = { git = "https://github.com/erichdongubler-contrib/socket2", rev = "d4ed5f73ddb051ac700e1b7ee66a72905a86a05e" } diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 54f2ecb8a4f..5be06096966 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -26,7 +26,7 @@ once_cell = "1.5.2" rand = "0.8.3" [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 86017871680..ba412508cd6 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -117,7 +117,7 @@ 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] 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 db3c15790ce..baa4a3728e8 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, Command as StdCommand, ExitStatus}; +use std::ptr::null_mut; use std::sync::Arc; use std::task::{Context, Poll}; @@ -120,7 +121,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,