Fix regression changing affinity for multi-group processes
@@ -319,25 +319,10 @@ INT_PTR CALLBACK PhpProcessAffinityDlgProc(
PROCESS_QUERY_LIMITED_INFORMATION,
context->ProcessItem->ProcessId
)))
- {
- USHORT groupBuffer[20] = { 0 };
- USHORT groupCount = RTL_NUMBER_OF(groupBuffer);
-
- if (NT_SUCCESS(PhGetProcessGroupInformation(
- processHandle,
- &groupCount,
- groupBuffer
- )) && groupCount > 1)
- {
- // We can't change affinity of multi-group processes. We can only change
- // affinity for individual threads in this case. (dmex).
- status = STATUS_RETRY;
- }
-
- if (NT_SUCCESS(status))
{
status = PhGetProcessGroupAffinity(processHandle, &processGroupAffinity);
+ // Add workaround for current process (dmex)
if (status == STATUS_INVALID_PARAMETER && context->ProcessItem->ProcessId == NtCurrentProcessId())
{
PROCESS_BASIC_INFORMATION basicInfo;
@@ -360,7 +345,6 @@ INT_PTR CALLBACK PhpProcessAffinityDlgProc(
ComboBox_SetCurSel(context->GroupComboHandle, processGroupAffinity.Group);
}
}
- }
NtClose(processHandle);
}
