use windows::Win32::Foundation::HANDLE;
use windows::Win32::System::Threading::TerminateProcess;
pub(crate) trait Kernel: Sync {
fn terminate(&self, handle: HANDLE, exit_code: u32) -> windows::core::Result<()>;
}
pub(crate) struct HostKernel;
impl Kernel for HostKernel {
fn terminate(&self, handle: HANDLE, exit_code: u32) -> windows::core::Result<()> {
unsafe { TerminateProcess(handle, exit_code) }
}
}
forward_kernel! {
fn terminate(&self, handle: HANDLE, exit_code: u32) -> windows::core::Result<()>;
}
#[cfg(test)]
#[path = "kernel/fake.rs"]
pub(crate) mod fake;