diff --git a/Cargo.lock b/Cargo.lock index 36ac76a34..5379c1a93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4958,7 +4958,7 @@ dependencies = [ "uv-state", "uv-warnings", "which", - "winapi", + "windows-sys 0.52.0", "winsafe", ] diff --git a/Cargo.toml b/Cargo.toml index ac820dd55..e3213201b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -153,7 +153,7 @@ url = { version = "2.5.0" } urlencoding = { version = "2.1.3" } walkdir = { version = "2.5.0" } which = { version = "6.0.0", features = ["regex"] } -winapi = { version = "0.3.9", features = ["fileapi", "handleapi", "ioapiset", "winbase", "winioctl", "winnt"] } +windows-sys = { version = "0.52.0", features = ["Win32_Foundation", "Win32_Security", "Win32_Storage_FileSystem", "Win32_System_Ioctl", "Win32_System_IO"] } winreg = { version = "0.52.0" } winsafe = { version = "0.0.19", features = ["kernel"] } wiremock = { version = "0.6.0" } diff --git a/crates/uv-python/Cargo.toml b/crates/uv-python/Cargo.toml index 706f88902..7aeb7727c 100644 --- a/crates/uv-python/Cargo.toml +++ b/crates/uv-python/Cargo.toml @@ -55,7 +55,7 @@ which = { workspace = true } rustix = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] -winapi = { workspace = true } +windows-sys = { workspace = true } winsafe = { workspace = true } [dev-dependencies] diff --git a/crates/uv-python/src/discovery.rs b/crates/uv-python/src/discovery.rs index efcd8d718..5e7d7ea84 100644 --- a/crates/uv-python/src/discovery.rs +++ b/crates/uv-python/src/discovery.rs @@ -923,12 +923,13 @@ fn warn_on_unsupported_python(interpreter: &Interpreter) { pub(crate) fn is_windows_store_shim(path: &Path) -> bool { use std::os::windows::fs::MetadataExt; use std::os::windows::prelude::OsStrExt; - use winapi::um::fileapi::{CreateFileW, OPEN_EXISTING}; - use winapi::um::handleapi::{CloseHandle, INVALID_HANDLE_VALUE}; - use winapi::um::ioapiset::DeviceIoControl; - use winapi::um::winbase::{FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OPEN_REPARSE_POINT}; - use winapi::um::winioctl::FSCTL_GET_REPARSE_POINT; - use winapi::um::winnt::{FILE_ATTRIBUTE_REPARSE_POINT, MAXIMUM_REPARSE_DATA_BUFFER_SIZE}; + use windows_sys::Win32::Foundation::{CloseHandle, INVALID_HANDLE_VALUE}; + use windows_sys::Win32::Storage::FileSystem::{ + CreateFileW, FILE_ATTRIBUTE_REPARSE_POINT, FILE_FLAG_BACKUP_SEMANTICS, + FILE_FLAG_OPEN_REPARSE_POINT, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, OPEN_EXISTING, + }; + use windows_sys::Win32::System::Ioctl::FSCTL_GET_REPARSE_POINT; + use windows_sys::Win32::System::IO::DeviceIoControl; // The path must be absolute. if !path.is_absolute() { @@ -988,7 +989,7 @@ pub(crate) fn is_windows_store_shim(path: &Path) -> bool { std::ptr::null_mut(), OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, - std::ptr::null_mut(), + 0, ) };