Skip to content

Commit 4eef5d0

Browse files
committed
Allow empty handles tab for system processes without kernel driver support
1 parent 9bc1ca0 commit 4eef5d0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ProcessHacker/hndlprv.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ NTSTATUS PhEnumHandlesGeneric(
308308
// * On Windows XP and later, NtQuerySystemInformation with SystemExtendedHandleInformation.
309309
// * Otherwise, NtQuerySystemInformation with SystemHandleInformation can be used.
310310

311-
if (KphIsConnected())
311+
if (KphIsConnected() && ProcessHandle)
312312
{
313313
PKPH_PROCESS_HANDLE_INFORMATION handles;
314314
PSYSTEM_HANDLE_INFORMATION_EX convertedHandles;
@@ -344,7 +344,7 @@ NTSTATUS PhEnumHandlesGeneric(
344344
}
345345
}
346346

347-
if (!NT_SUCCESS(status) && WindowsVersion >= WINDOWS_8 && PhGetIntegerSetting(L"EnableHandleSnapshot"))
347+
if (!NT_SUCCESS(status) && WindowsVersion >= WINDOWS_8 && ProcessHandle && PhGetIntegerSetting(L"EnableHandleSnapshot"))
348348
{
349349
PPROCESS_HANDLE_SNAPSHOT_INFORMATION handles;
350350
PSYSTEM_HANDLE_INFORMATION_EX convertedHandles;
@@ -451,9 +451,6 @@ VOID PhHandleProviderUpdate(
451451
BOOLEAN useWorkQueue = FALSE;
452452
PH_WORK_QUEUE workQueue;
453453

454-
if (!handleProvider->ProcessHandle)
455-
goto UpdateExit;
456-
457454
if (!NT_SUCCESS(handleProvider->RunStatus = PhEnumHandlesGeneric(
458455
handleProvider->ProcessId,
459456
handleProvider->ProcessHandle,

0 commit comments

Comments
 (0)