diff --git a/2.x/trunk/CHANGELOG.txt b/2.x/trunk/CHANGELOG.txt index 59208ef14..46cbd8102 100644 --- a/2.x/trunk/CHANGELOG.txt +++ b/2.x/trunk/CHANGELOG.txt @@ -6,6 +6,7 @@ Process Hacker for processes * Command line support for setting process priority and I/O priority + * Improved termination of explorer.exe * FIXED: * Icon should restore the main window if it is minimized * System Information window crashes diff --git a/2.x/trunk/ProcessHacker/actions.c b/2.x/trunk/ProcessHacker/actions.c index 3c5d67a08..ede202510 100644 --- a/2.x/trunk/ProcessHacker/actions.c +++ b/2.x/trunk/ProcessHacker/actions.c @@ -820,7 +820,11 @@ BOOLEAN PhUiTerminateProcesses( Processes[i]->ProcessId ))) { - status = PhTerminateProcess(processHandle, STATUS_SUCCESS); + // An exit status of 1 is used here for compatibility reasons: + // 1. Both Task Manager and Process Explorer use 1. + // 2. winlogon tries to restart explorer.exe if the exit status is not 1. + + status = PhTerminateProcess(processHandle, 1); NtClose(processHandle); } diff --git a/2.x/trunk/ProcessHacker/phsvc/svcapi.c b/2.x/trunk/ProcessHacker/phsvc/svcapi.c index bc7e03d50..dc31bdd7f 100644 --- a/2.x/trunk/ProcessHacker/phsvc/svcapi.c +++ b/2.x/trunk/ProcessHacker/phsvc/svcapi.c @@ -223,7 +223,7 @@ NTSTATUS PhSvcApiControlProcess( case PhSvcControlProcessTerminate: if (NT_SUCCESS(status = PhOpenProcess(&processHandle, PROCESS_TERMINATE, processId))) { - status = PhTerminateProcess(processHandle, STATUS_SUCCESS); + status = PhTerminateProcess(processHandle, 1); // see notes in PhUiTerminateProcesses NtClose(processHandle); } break;