From bacfa68ed01227292d1fa2b44f5c955fc7320b1d Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 6 Aug 2024 23:18:20 +0200 Subject: [PATCH] Fix conditional compilation --- src/proc.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/proc.rs b/src/proc.rs index 86282f6..db7e8f1 100644 --- a/src/proc.rs +++ b/src/proc.rs @@ -12,7 +12,6 @@ use std::{io, thread}; use ipc_channel::ipc::{self, IpcOneShotServer, IpcReceiver, IpcSender}; use serde::{de::DeserializeOwned, Serialize}; -use windows_sys::Win32::System::Threading::{OpenProcess, TerminateProcess, PROCESS_ALL_ACCESS}; use crate::core::{assert_spawn_okay, should_pass_args, MarshalledCall, ENV_NAME}; use crate::error::{PanicInfo, SpawnError}; @@ -339,8 +338,10 @@ impl ProcessHandleState { } #[cfg(windows)] { - let proc = OpenProcess(PROCESS_ALL_ACCESS, 0, pid as _); - TerminateProcess(proc, 1); + use windows_sys::Win32::System::Threading; + let proc = + Threading::OpenProcess(Threading::PROCESS_ALL_ACCESS, 0, pid as _); + Threading::TerminateProcess(proc, 1); } } }