Skip to content

Commit 0f3a931

Browse files
committed
port winbase
1 parent 987d50c commit 0f3a931

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

vm/src/stdlib/winapi.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod _winapi {
1212
PyObjectRef, PyResult, TryFromObject, VirtualMachine,
1313
};
1414
use std::ptr::{null, null_mut};
15-
use winapi::um::winbase;
1615
use windows::{
1716
core::PCWSTR,
1817
Win32::Foundation::{HANDLE, HINSTANCE, MAX_PATH},
@@ -227,7 +226,8 @@ mod _winapi {
227226
args: CreateProcessArgs,
228227
vm: &VirtualMachine,
229228
) -> PyResult<(HANDLE, HANDLE, u32, u32)> {
230-
let mut si = winbase::STARTUPINFOEXW::default();
229+
let mut si: windows_sys::Win32::System::Threading::STARTUPINFOEXW =
230+
unsafe { std::mem::zeroed() };
231231
si.StartupInfo.cb = std::mem::size_of_val(&si) as _;
232232

233233
macro_rules! si_attr {
@@ -292,11 +292,11 @@ mod _winapi {
292292
std::ptr::null(),
293293
args.inherit_handles,
294294
args.creation_flags
295-
| winbase::EXTENDED_STARTUPINFO_PRESENT
296-
| winbase::CREATE_UNICODE_ENVIRONMENT,
295+
| windows_sys::Win32::System::Threading::EXTENDED_STARTUPINFO_PRESENT
296+
| windows_sys::Win32::System::Threading::CREATE_UNICODE_ENVIRONMENT,
297297
env as _,
298298
current_dir,
299-
&mut si as *mut winbase::STARTUPINFOEXW as _,
299+
&mut si as *mut _ as *mut _,
300300
procinfo.as_mut_ptr(),
301301
))
302302
.into_pyresult(vm)?;
@@ -390,7 +390,7 @@ mod _winapi {
390390
(result, size.assume_init())
391391
};
392392
if !result.is_err()
393-
|| GetLastError() != winapi::shared::winerror::ERROR_INSUFFICIENT_BUFFER
393+
|| GetLastError() != windows_sys::Win32::Foundation::ERROR_INSUFFICIENT_BUFFER
394394
{
395395
return Err(errno_err(vm));
396396
}

0 commit comments

Comments
 (0)