diff --git a/driver/src/process/ioctls.rs b/driver/src/process/ioctls.rs index bc3cd40..fa5fe74 100644 --- a/driver/src/process/ioctls.rs +++ b/driver/src/process/ioctls.rs @@ -78,7 +78,6 @@ pub fn get_process_ioctls(ioctls: &mut HashMap) { // 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) { status }) as IoctlHandler); } - } \ No newline at end of file diff --git a/driver/src/thread/ioctls.rs b/driver/src/thread/ioctls.rs index 0fb3936..31a4d2b 100644 --- a/driver/src/thread/ioctls.rs +++ b/driver/src/thread/ioctls.rs @@ -45,10 +45,13 @@ pub fn get_thread_ioctls(ioctls: &mut HashMap) { 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:: 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:: as u64 }; + status + }) as IoctlHandler); + } } \ No newline at end of file