diff --git a/Cargo.toml b/Cargo.toml index 447d9d8dd..f65465176 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,13 +49,16 @@ log = { version = "0.4.8", optional = true } libc = "0.2.149" [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.48" +version = "0.52" features = [ "Win32_Foundation", # Basic types eg HANDLE "Win32_Networking_WinSock", # winsock2 types/functions "Win32_Storage_FileSystem", # Enables NtCreateFile "Win32_System_IO", # IO types like OVERLAPPED etc "Win32_System_WindowsProgramming", # General future used for various types/funcs + "Wdk_Foundation", # Basic WDK types + "Wdk_Storage_FileSystem", # NT APIs for file system IO + "Wdk_System_IO", # NT APIs for general IO ] [target.'cfg(target_os = "wasi")'.dependencies] diff --git a/src/sys/windows/afd.rs b/src/sys/windows/afd.rs index 3bda4536c..2528edad9 100644 --- a/src/sys/windows/afd.rs +++ b/src/sys/windows/afd.rs @@ -5,12 +5,11 @@ use std::io; use std::mem::size_of; use std::os::windows::io::AsRawHandle; +use windows_sys::Wdk::System::IO::NtDeviceIoControlFile; use windows_sys::Win32::Foundation::{ RtlNtStatusToDosError, HANDLE, NTSTATUS, STATUS_NOT_FOUND, STATUS_PENDING, STATUS_SUCCESS, }; -use windows_sys::Win32::System::WindowsProgramming::{ - NtDeviceIoControlFile, IO_STATUS_BLOCK, IO_STATUS_BLOCK_0, -}; +use windows_sys::Win32::System::IO::{IO_STATUS_BLOCK, IO_STATUS_BLOCK_0}; const IOCTL_AFD_POLL: u32 = 0x00012024; @@ -136,9 +135,13 @@ cfg_io_source! { use windows_sys::Win32::{ Foundation::{UNICODE_STRING, INVALID_HANDLE_VALUE}, System::WindowsProgramming::{ - OBJECT_ATTRIBUTES, FILE_SKIP_SET_EVENT_ON_HANDLE, + FILE_SKIP_SET_EVENT_ON_HANDLE, }, - Storage::FileSystem::{FILE_OPEN, NtCreateFile, SetFileCompletionNotificationModes, SYNCHRONIZE, FILE_SHARE_READ, FILE_SHARE_WRITE}, + Storage::FileSystem::{SetFileCompletionNotificationModes, SYNCHRONIZE, FILE_SHARE_READ, FILE_SHARE_WRITE}, + }; + use windows_sys::Wdk::{ + Foundation::OBJECT_ATTRIBUTES, + Storage::FileSystem::{NtCreateFile, FILE_OPEN} }; const AFD_HELPER_ATTRIBUTES: OBJECT_ATTRIBUTES = OBJECT_ATTRIBUTES { diff --git a/src/sys/windows/io_status_block.rs b/src/sys/windows/io_status_block.rs index d7eda6a6d..79b1a44db 100644 --- a/src/sys/windows/io_status_block.rs +++ b/src/sys/windows/io_status_block.rs @@ -1,12 +1,12 @@ use std::fmt; use std::ops::{Deref, DerefMut}; -use windows_sys::Win32::System::WindowsProgramming::IO_STATUS_BLOCK; +use windows_sys::Win32::System::IO::IO_STATUS_BLOCK; pub struct IoStatusBlock(IO_STATUS_BLOCK); cfg_io_source! { - use windows_sys::Win32::System::WindowsProgramming::{IO_STATUS_BLOCK_0}; + use windows_sys::Win32::System::IO::{IO_STATUS_BLOCK_0}; impl IoStatusBlock { pub fn zeroed() -> Self {