From 64d2e5a3d61403eca1ff7ac0f83af653e484196c Mon Sep 17 00:00:00 2001 From: Jacobtread Date: Thu, 23 May 2024 18:38:17 +1200 Subject: [PATCH] fix: disable killing nested processes Depth to zero for now to prevent killing parent processes --- src/windows.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/windows.rs b/src/windows.rs index 19070b6..1fab695 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -162,7 +162,10 @@ impl ProcessLookupTable { /// WARNING - This worked in the previous versions because the implementation /// was flawwed and didn't properly look up the tree of parents, trying to kill /// all of the parents causes problems since you'll end up killing explorer.exe -/// or some other windows sys process. So I've limited the depth to a single process deep +/// or some other windows sys process. This has been disabled (Depth of 0) but +/// may be enabled in a future release +/// +/// /// /// # Arguments /// @@ -171,7 +174,7 @@ fn lookup_process_parents( lookup_table: &ProcessLookupTable, process: &mut WindowsProcess, ) -> Result<()> { - const MAX_PARENT_DEPTH: u8 = 1; + const MAX_PARENT_DEPTH: u8 = 0; let mut current_procces = process; let mut depth = 0;