Skip to content

Commit 53e3df4

Browse files
committed
Show owning process for ALPC handles
1 parent b2afb71 commit 53e3df4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ProcessHacker/hndlprp.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,17 @@ VOID PhpUpdateHandleGeneralListViewGroups(
389389
L"Port Context",
390390
NULL
391391
);
392+
393+
if (WindowsVersion >= WINDOWS_10_19H2)
394+
{
395+
Context->ListViewRowCache[PH_HANDLE_GENERAL_INDEX_MUTANTOWNER] = PhAddListViewGroupItem(
396+
Context->ListViewHandle,
397+
PH_HANDLE_GENERAL_CATEGORY_ALPC,
398+
PH_HANDLE_GENERAL_INDEX_MUTANTOWNER,
399+
L"Owner",
400+
NULL
401+
);
402+
}
392403
}
393404
else if (PhEqualString2(Context->HandleItem->TypeName, L"EtwRegistration", TRUE))
394405
{
@@ -699,6 +710,30 @@ VOID PhpUpdateHandleGeneral(
699710
PhSetListViewSubItem(Context->ListViewHandle, Context->ListViewRowCache[PH_HANDLE_GENERAL_INDEX_PORTCONTEXT], 1, string);
700711
}
701712

713+
if (WindowsVersion >= WINDOWS_10_19H2)
714+
{
715+
ALPC_SERVER_SESSION_INFORMATION serverInfo;
716+
717+
if (NT_SUCCESS(NtAlpcQueryInformation(
718+
alpcPortHandle,
719+
AlpcServerSessionInformation,
720+
&serverInfo,
721+
sizeof(ALPC_SERVER_SESSION_INFORMATION),
722+
NULL
723+
)))
724+
{
725+
CLIENT_ID clientId;
726+
PPH_STRING name;
727+
728+
clientId.UniqueProcess = UlongToHandle(serverInfo.ProcessId);
729+
clientId.UniqueThread = 0;
730+
731+
name = PhStdGetClientIdName(&clientId);
732+
PhSetListViewSubItem(Context->ListViewHandle, Context->ListViewRowCache[PH_HANDLE_GENERAL_INDEX_MUTANTOWNER], 1, name->Buffer);
733+
PhDereferenceObject(name);
734+
}
735+
}
736+
702737
NtClose(alpcPortHandle);
703738
}
704739
#endif

0 commit comments

Comments
 (0)