From 0876e610dbaf79735291d0aad97f4c29aeb68661 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 12 Apr 2023 21:31:32 +0900 Subject: [PATCH] Update windows-sys to 0.48 --- Cargo.toml | 4 ++-- src/platform/windows/mod.rs | 3 +-- src/tests.rs | 9 +++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a7d5302..7b45974 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,10 +17,10 @@ readme = "README.md" nix = { version = "0.26", default-features = false, features = ["fs", "signal"]} [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.45", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_Security", "Win32_System_WindowsProgramming", "Win32_System_Console"] } +windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_Security", "Win32_System_Console"] } [target.'cfg(windows)'.dev-dependencies] -windows-sys = { version = "0.45", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_IO", "Win32_System_SystemServices", "Win32_System_Console"] } +windows-sys = { version = "0.48", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_IO", "Win32_System_Console"] } [features] termination = [] diff --git a/src/platform/windows/mod.rs b/src/platform/windows/mod.rs index dec02d0..9e3279a 100644 --- a/src/platform/windows/mod.rs +++ b/src/platform/windows/mod.rs @@ -12,9 +12,8 @@ use std::ptr; use windows_sys::Win32::Foundation::{CloseHandle, BOOL, HANDLE, WAIT_FAILED, WAIT_OBJECT_0}; use windows_sys::Win32::System::Console::SetConsoleCtrlHandler; use windows_sys::Win32::System::Threading::{ - CreateSemaphoreA, ReleaseSemaphore, WaitForSingleObject, + CreateSemaphoreA, ReleaseSemaphore, WaitForSingleObject, INFINITE, }; -use windows_sys::Win32::System::WindowsProgramming::INFINITE; /// Platform specific error type pub type Error = io::Error; diff --git a/src/tests.rs b/src/tests.rs index 5e24868..66d2f44 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -34,7 +34,9 @@ mod platform { mod platform { use std::io; use std::ptr; - use windows_sys::Win32::Foundation::{CHAR, HANDLE, INVALID_HANDLE_VALUE}; + use windows_sys::Win32::Foundation::{ + GENERIC_READ, GENERIC_WRITE, HANDLE, INVALID_HANDLE_VALUE, + }; use windows_sys::Win32::Storage::FileSystem::{ CreateFileA, WriteFile, FILE_SHARE_WRITE, OPEN_EXISTING, }; @@ -43,7 +45,6 @@ mod platform { GetStdHandle, SetStdHandle, ATTACH_PARENT_PROCESS, CTRL_C_EVENT, STD_ERROR_HANDLE, STD_OUTPUT_HANDLE, }; - use windows_sys::Win32::System::SystemServices::{GENERIC_READ, GENERIC_WRITE}; /// Stores a piped stdout handle or a cache that gets /// flushed when we reattached to the old console. @@ -61,7 +62,7 @@ mod platform { let mut n = 0u32; if WriteFile( handle, - buf.as_ptr() as *const core::ffi::c_void, + buf.as_ptr(), buf.len() as u32, &mut n as *mut u32, ptr::null_mut(), @@ -129,7 +130,7 @@ mod platform { unsafe fn get_stdout() -> io::Result { let stdout = CreateFileA( - "CONOUT$\0".as_ptr() as *const CHAR, + "CONOUT$\0".as_ptr(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_WRITE, ptr::null_mut(),