Skip to content

Commit

Permalink
Fix idle process thread identifiers on Windows 11
Browse files Browse the repository at this point in the history
  • Loading branch information
dmex committed Jun 11, 2022
1 parent 88efc1d commit 53295b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ProcessHacker/thrdprv.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,14 @@ VOID PhpThreadProviderUpdate(
// TIDs, so we'll assign unique TIDs. (wj32)
if (threadProvider->ProcessId == SYSTEM_IDLE_PROCESS_ID)
{
ULONG processorIndex = 0;

for (i = 0; i < numberOfThreads; i++)
{
if (!threads[i].ClientId.UniqueThread) // Don't assign a pseudo TID when there's a valid TID (dmex)
if (!threads[i].ClientId.UniqueThread)
{
threads[i].ClientId.UniqueThread = UlongToHandle(i);
threads[i].ClientId.UniqueThread = UlongToHandle(processorIndex);
processorIndex++;
}
}
}
Expand Down

0 comments on commit 53295b2

Please sign in to comment.