mirror of
https://github.com/joaoviictorti/shadow-rs.git
synced 2026-01-14 13:04:42 +01:00
fix: add missing thread termination protection when mapper feature is disabled
This commit is contained in:
@@ -78,7 +78,6 @@ pub fn get_process_ioctls(ioctls: &mut HashMap<u32, IoctlHandler>) {
|
||||
|
||||
// If the feature is a mapper, these functionalities will not be added.
|
||||
#[cfg(not(feature = "mapper"))] {
|
||||
|
||||
// Responsible for adding shutdown protection / memory dumping for a process.
|
||||
ioctls.insert(IOCTL_PROTECTION_PROCESS, Box::new(|irp: *mut IRP, stack: *mut IO_STACK_LOCATION | {
|
||||
let status = unsafe { handle!(stack, add_remove_process_toggle, ProcessProtection) };
|
||||
@@ -87,6 +86,5 @@ pub fn get_process_ioctls(ioctls: &mut HashMap<u32, IoctlHandler>) {
|
||||
status
|
||||
}) as IoctlHandler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,10 +45,13 @@ pub fn get_thread_ioctls(ioctls: &mut HashMap<u32, IoctlHandler>) {
|
||||
status
|
||||
}) as IoctlHandler);
|
||||
|
||||
// Responsible for adding thread termination protection.
|
||||
ioctls.insert(IOCTL_PROTECTION_THREAD, Box::new(|irp: *mut IRP, stack: *mut IO_STACK_LOCATION | {
|
||||
let status = unsafe { handle!(stack, add_remove_thread_toggle, ThreadProtection) };
|
||||
unsafe { (*irp).IoStatus.Information = size_of::<TargetThread> as u64 };
|
||||
status
|
||||
}) as IoctlHandler);
|
||||
// If the feature is a mapper, these functionalities will not be added.
|
||||
#[cfg(not(feature = "mapper"))] {
|
||||
// Responsible for adding thread termination protection.
|
||||
ioctls.insert(IOCTL_PROTECTION_THREAD, Box::new(|irp: *mut IRP, stack: *mut IO_STACK_LOCATION | {
|
||||
let status = unsafe { handle!(stack, add_remove_thread_toggle, ThreadProtection) };
|
||||
unsafe { (*irp).IoStatus.Information = size_of::<TargetThread> as u64 };
|
||||
status
|
||||
}) as IoctlHandler);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user