mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Bump windows-sys from 0.59.0 to 0.61.2 (#6346)
* Bump windows-sys from 0.59.0 to 0.61.2 Bumps [windows-sys](https://github.com/microsoft/windows-rs) from 0.59.0 to 0.61.2. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/commits) --- updated-dependencies: - dependency-name: windows-sys dependency-version: 0.61.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Fix breaking changes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jeong, YunWon <jeong@youknowone.org>
This commit is contained in:
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -1170,7 +1170,7 @@ checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"rustix",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2987,7 +2987,7 @@ dependencies = [
|
||||
"siphasher",
|
||||
"unicode_names2 2.0.0",
|
||||
"widestring",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3186,7 +3186,7 @@ dependencies = [
|
||||
"uuid",
|
||||
"webpki-roots",
|
||||
"widestring",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.61.2",
|
||||
"x509-cert",
|
||||
"x509-parser",
|
||||
"xml",
|
||||
@@ -3266,7 +3266,7 @@ dependencies = [
|
||||
"which",
|
||||
"widestring",
|
||||
"windows",
|
||||
"windows-sys 0.59.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -219,7 +219,7 @@ unic-ucd-ident = "0.9.0"
|
||||
unicode_names2 = "2.0.0"
|
||||
unicode-bidi-mirroring = "0.4"
|
||||
widestring = "1.2.0"
|
||||
windows-sys = "0.59.0"
|
||||
windows-sys = "0.61.2"
|
||||
wasm-bindgen = "0.2.100"
|
||||
|
||||
# Lints
|
||||
|
||||
@@ -30,7 +30,7 @@ pub mod windows {
|
||||
use std::os::windows::io::AsRawHandle;
|
||||
use std::sync::OnceLock;
|
||||
use windows_sys::Win32::Foundation::{
|
||||
BOOL, ERROR_INVALID_HANDLE, ERROR_NOT_SUPPORTED, FILETIME, FreeLibrary, SetLastError,
|
||||
ERROR_INVALID_HANDLE, ERROR_NOT_SUPPORTED, FILETIME, FreeLibrary, SetLastError,
|
||||
};
|
||||
use windows_sys::Win32::Storage::FileSystem::{
|
||||
BY_HANDLE_FILE_INFORMATION, FILE_ATTRIBUTE_DIRECTORY, FILE_ATTRIBUTE_READONLY,
|
||||
@@ -299,7 +299,7 @@ pub mod windows {
|
||||
FILE_INFO_BY_NAME_CLASS,
|
||||
*mut libc::c_void,
|
||||
u32,
|
||||
) -> BOOL,
|
||||
) -> i32,
|
||||
>,
|
||||
> = OnceLock::new();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ mod _winapi {
|
||||
Win32::Foundation::{HANDLE, HINSTANCE, MAX_PATH},
|
||||
core::PCWSTR,
|
||||
};
|
||||
use windows_sys::Win32::Foundation::{BOOL, INVALID_HANDLE_VALUE};
|
||||
use windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE;
|
||||
|
||||
#[pyattr]
|
||||
use windows_sys::Win32::{
|
||||
@@ -36,14 +36,19 @@ mod _winapi {
|
||||
LCMAP_TRADITIONAL_CHINESE, LCMAP_UPPERCASE,
|
||||
},
|
||||
Storage::FileSystem::{
|
||||
COPYFILE2_CALLBACK_CHUNK_FINISHED, COPYFILE2_CALLBACK_CHUNK_STARTED,
|
||||
COPYFILE2_CALLBACK_ERROR, COPYFILE2_CALLBACK_POLL_CONTINUE,
|
||||
COPYFILE2_CALLBACK_STREAM_FINISHED, COPYFILE2_CALLBACK_STREAM_STARTED,
|
||||
COPYFILE2_PROGRESS_CANCEL, COPYFILE2_PROGRESS_CONTINUE, COPYFILE2_PROGRESS_PAUSE,
|
||||
COPYFILE2_PROGRESS_QUIET, COPYFILE2_PROGRESS_STOP, FILE_FLAG_FIRST_PIPE_INSTANCE,
|
||||
FILE_FLAG_OVERLAPPED, FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_TYPE_CHAR,
|
||||
FILE_TYPE_DISK, FILE_TYPE_PIPE, FILE_TYPE_REMOTE, FILE_TYPE_UNKNOWN, OPEN_EXISTING,
|
||||
PIPE_ACCESS_DUPLEX, PIPE_ACCESS_INBOUND, SYNCHRONIZE,
|
||||
COPY_FILE_ALLOW_DECRYPTED_DESTINATION, COPY_FILE_COPY_SYMLINK,
|
||||
COPY_FILE_FAIL_IF_EXISTS, COPY_FILE_NO_BUFFERING, COPY_FILE_NO_OFFLOAD,
|
||||
COPY_FILE_OPEN_SOURCE_FOR_WRITE, COPY_FILE_REQUEST_COMPRESSED_TRAFFIC,
|
||||
COPY_FILE_REQUEST_SECURITY_PRIVILEGES, COPY_FILE_RESTARTABLE,
|
||||
COPY_FILE_RESUME_FROM_PAUSE, COPYFILE2_CALLBACK_CHUNK_FINISHED,
|
||||
COPYFILE2_CALLBACK_CHUNK_STARTED, COPYFILE2_CALLBACK_ERROR,
|
||||
COPYFILE2_CALLBACK_POLL_CONTINUE, COPYFILE2_CALLBACK_STREAM_FINISHED,
|
||||
COPYFILE2_CALLBACK_STREAM_STARTED, COPYFILE2_PROGRESS_CANCEL,
|
||||
COPYFILE2_PROGRESS_CONTINUE, COPYFILE2_PROGRESS_PAUSE, COPYFILE2_PROGRESS_QUIET,
|
||||
COPYFILE2_PROGRESS_STOP, FILE_FLAG_FIRST_PIPE_INSTANCE, FILE_FLAG_OVERLAPPED,
|
||||
FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_TYPE_CHAR, FILE_TYPE_DISK, FILE_TYPE_PIPE,
|
||||
FILE_TYPE_REMOTE, FILE_TYPE_UNKNOWN, OPEN_EXISTING, PIPE_ACCESS_DUPLEX,
|
||||
PIPE_ACCESS_INBOUND, SYNCHRONIZE,
|
||||
},
|
||||
System::{
|
||||
Console::{STD_ERROR_HANDLE, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE},
|
||||
@@ -65,13 +70,6 @@ mod _winapi {
|
||||
IDLE_PRIORITY_CLASS, INFINITE, NORMAL_PRIORITY_CLASS, PROCESS_DUP_HANDLE,
|
||||
REALTIME_PRIORITY_CLASS, STARTF_USESHOWWINDOW, STARTF_USESTDHANDLES,
|
||||
},
|
||||
WindowsProgramming::{
|
||||
COPY_FILE_ALLOW_DECRYPTED_DESTINATION, COPY_FILE_COPY_SYMLINK,
|
||||
COPY_FILE_FAIL_IF_EXISTS, COPY_FILE_NO_BUFFERING, COPY_FILE_NO_OFFLOAD,
|
||||
COPY_FILE_OPEN_SOURCE_FOR_WRITE, COPY_FILE_REQUEST_COMPRESSED_TRAFFIC,
|
||||
COPY_FILE_REQUEST_SECURITY_PRIVILEGES, COPY_FILE_RESTARTABLE,
|
||||
COPY_FILE_RESUME_FROM_PAUSE,
|
||||
},
|
||||
},
|
||||
UI::WindowsAndMessaging::SW_HIDE,
|
||||
};
|
||||
@@ -80,7 +78,7 @@ mod _winapi {
|
||||
const NULL: isize = 0;
|
||||
|
||||
#[pyfunction]
|
||||
fn CloseHandle(handle: HANDLE) -> WindowsSysResult<BOOL> {
|
||||
fn CloseHandle(handle: HANDLE) -> WindowsSysResult<i32> {
|
||||
WindowsSysResult(unsafe { windows_sys::Win32::Foundation::CloseHandle(handle.0 as _) })
|
||||
}
|
||||
|
||||
@@ -128,7 +126,7 @@ mod _winapi {
|
||||
src: HANDLE,
|
||||
target_process: HANDLE,
|
||||
access: u32,
|
||||
inherit: BOOL,
|
||||
inherit: i32,
|
||||
options: OptionalArg<u32>,
|
||||
vm: &VirtualMachine,
|
||||
) -> PyResult<HANDLE> {
|
||||
@@ -299,7 +297,7 @@ mod _winapi {
|
||||
unsafe {
|
||||
windows_sys::Win32::System::Threading::OpenProcess(
|
||||
desired_access,
|
||||
BOOL::from(inherit_handle),
|
||||
i32::from(inherit_handle),
|
||||
process_id,
|
||||
) as _
|
||||
}
|
||||
@@ -473,7 +471,7 @@ mod _winapi {
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
fn TerminateProcess(h: HANDLE, exit_code: u32) -> WindowsSysResult<BOOL> {
|
||||
fn TerminateProcess(h: HANDLE, exit_code: u32) -> WindowsSysResult<i32> {
|
||||
WindowsSysResult(unsafe {
|
||||
windows_sys::Win32::System::Threading::TerminateProcess(h.0 as _, exit_code)
|
||||
})
|
||||
@@ -513,7 +511,7 @@ mod _winapi {
|
||||
let handle = unsafe {
|
||||
windows_sys::Win32::System::Threading::OpenMutexW(
|
||||
desired_access,
|
||||
BOOL::from(inherit_handle),
|
||||
i32::from(inherit_handle),
|
||||
windows_sys::core::PCWSTR::from(name as _),
|
||||
)
|
||||
};
|
||||
@@ -524,7 +522,7 @@ mod _winapi {
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
fn ReleaseMutex(handle: isize) -> WindowsSysResult<BOOL> {
|
||||
fn ReleaseMutex(handle: isize) -> WindowsSysResult<i32> {
|
||||
WindowsSysResult(unsafe {
|
||||
windows_sys::Win32::System::Threading::ReleaseMutex(handle as _)
|
||||
})
|
||||
|
||||
@@ -1149,7 +1149,7 @@ mod winreg {
|
||||
|
||||
#[pyfunction]
|
||||
fn QueryReflectionKey(key: PyRef<PyHkey>, vm: &VirtualMachine) -> PyResult<bool> {
|
||||
let mut result: windows_sys::Win32::Foundation::BOOL = 0;
|
||||
let mut result: i32 = 0;
|
||||
let res = unsafe { Registry::RegQueryReflectionKey(key.hkey.load(), &mut result) };
|
||||
if res == 0 {
|
||||
Ok(result != 0)
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::{
|
||||
};
|
||||
use std::ffi::OsStr;
|
||||
use windows::Win32::Foundation::HANDLE;
|
||||
use windows_sys::Win32::Foundation::{BOOL, HANDLE as RAW_HANDLE, INVALID_HANDLE_VALUE};
|
||||
use windows_sys::Win32::Foundation::{HANDLE as RAW_HANDLE, INVALID_HANDLE_VALUE};
|
||||
|
||||
pub(crate) trait WindowsSysResultValue {
|
||||
type Ok: ToPyObject;
|
||||
@@ -27,7 +27,8 @@ impl WindowsSysResultValue for RAW_HANDLE {
|
||||
}
|
||||
}
|
||||
|
||||
impl WindowsSysResultValue for BOOL {
|
||||
// BOOL is i32 in windows-sys 0.61+
|
||||
impl WindowsSysResultValue for i32 {
|
||||
type Ok = ();
|
||||
fn is_err(&self) -> bool {
|
||||
*self == 0
|
||||
|
||||
Reference in New Issue
Block a user