fix(brush-core-vendored): correct windows_sys import paths and tokio child handle accessor

- DuplicateHandle and DUPLICATE_SAME_ACCESS live in Win32::Foundation,
  not Win32::System::Threading; split the use group accordingly.
- tokio::process::Child exposes raw_handle() (returning Option<RawHandle>),
  not as_raw_handle(); chain via and_then(duplicate_handle).

Caught by Windows CI on commit 2c8f115b6.
This commit is contained in:
can1357
2026-05-08 11:32:36 +02:00
parent 2c8f115b60
commit f55a2aab2d
+4 -3
View File
@@ -47,7 +47,7 @@ impl ChildProcess {
pgid: Option<sys::process::ProcessId>,
) -> Self {
#[cfg(windows)]
let kill_handle = duplicate_handle(child.as_raw_handle());
let kill_handle = child.raw_handle().and_then(duplicate_handle);
Self {
exec_future: Box::pin(child.wait_with_output()),
@@ -201,8 +201,9 @@ impl Drop for ChildProcess {
#[cfg(windows)]
fn duplicate_handle(handle: RawHandle) -> Option<OwnedHandle> {
use windows_sys::Win32::System::Threading::{
DUPLICATE_SAME_ACCESS, DuplicateHandle, GetCurrentProcess,
use windows_sys::Win32::{
Foundation::{DUPLICATE_SAME_ACCESS, DuplicateHandle},
System::Threading::GetCurrentProcess,
};
// SAFETY: GetCurrentProcess returns a pseudo-handle for the current process