Skip to content

Commit 788488d

Browse files
Fix Windows CI: move GetThreadContext/SetThreadContext to correct import path and fix HANDLE type
- GetThreadContext and SetThreadContext are in Win32::System::Diagnostics::Debug, not Win32::System::Threading - HANDLE is *mut c_void on Windows, not usize; use std::ptr::null_mut() for initialization Agent-Logs-Url: https://github.com/acl-dev/open-coroutine/sessions/5486070d-5dbe-4036-81a6-18cde48b0725 Co-authored-by: loongs-zhang <38336731+loongs-zhang@users.noreply.github.com>
1 parent 148a0b9 commit 788488d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

core/src/monitor.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ cfg_if::cfg_if! {
2424
};
2525
use windows_sys::Win32::System::Threading::{
2626
GetCurrentProcess, GetCurrentThread,
27-
SuspendThread, ResumeThread, GetThreadContext, SetThreadContext,
27+
SuspendThread, ResumeThread,
28+
};
29+
use windows_sys::Win32::System::Diagnostics::Debug::{
30+
CONTEXT, GetThreadContext, SetThreadContext,
2831
};
29-
use windows_sys::Win32::System::Diagnostics::Debug::CONTEXT;
3032
}
3133
}
3234

@@ -490,7 +492,7 @@ impl Monitor {
490492
};
491493
} else if #[cfg(windows)] {
492494
let node = unsafe {
493-
let mut real_handle: HANDLE = 0;
495+
let mut real_handle: HANDLE = std::ptr::null_mut();
494496
let result = DuplicateHandle(
495497
GetCurrentProcess(),
496498
GetCurrentThread(),

0 commit comments

Comments
 (0)