Skip to content

Commit

Permalink
Update windows-sys to 0.48
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and Detegr committed Apr 16, 2023
1 parent b631d3f commit 0876e61
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
3 changes: 1 addition & 2 deletions src/platform/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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.
Expand All @@ -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(),
Expand Down Expand Up @@ -129,7 +130,7 @@ mod platform {

unsafe fn get_stdout() -> io::Result<HANDLE> {
let stdout = CreateFileA(
"CONOUT$\0".as_ptr() as *const CHAR,
"CONOUT$\0".as_ptr(),
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_WRITE,
ptr::null_mut(),
Expand Down

0 comments on commit 0876e61

Please sign in to comment.