- Timestamp:
- Oct 22, 2024 11:33:19 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/w32/winchildren.c
r3617 r3627 357 357 /** Kernel32!SetThreadGroupAffinity */ 358 358 static BOOL (WINAPI *g_pfnSetThreadGroupAffinity)(HANDLE, CONST GROUP_AFFINITY *, GROUP_AFFINITY *); 359 /** Kernel32!SetThreadSelectedCpuSetMasks (windows 11+). */ 360 static BOOL (WINAPI *g_pfnSetThreadSelectedCpuSetMasks)(HANDLE, PGROUP_AFFINITY, USHORT); 361 /** Kernel32!SetProcessDefaultCpuSetMasks (windows 11+). */ 362 static BOOL (WINAPI *g_pfnSetProcessDefaultCpuSetMasks)(HANDLE, PGROUP_AFFINITY, USHORT); 359 363 /** NTDLL!NtQueryInformationProcess */ 360 364 static NTSTATUS (NTAPI *g_pfnNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); 365 361 366 /** Set if the windows host is 64-bit. */ 362 367 static BOOL g_f64BitHost = (K_ARCH_BITS == 64); … … 470 475 *(FARPROC *)&g_pfnSetThreadGroupAffinity = GetProcAddress(hmod, "SetThreadGroupAffinity"); 471 476 *(FARPROC *)&g_pfnGetLogicalProcessorInformationEx = GetProcAddress(hmod, "GetLogicalProcessorInformationEx"); 472 /*(FARPROC *)&g_pfnGetSystemCpuSetInformation = GetProcAddress(hmod, "GetSystemCpuSetInformation"); / * W10*/473 /*(FARPROC *)&g_pfnSetThreadSelectedCpuSetMasks = GetProcAddress(hmod, "SetThreadSelectedCpuSetMasks"); /* W11 */477 *(FARPROC *)&g_pfnSetThreadSelectedCpuSetMasks = GetProcAddress(hmod, "SetThreadSelectedCpuSetMasks"); /* W11 */ 478 *(FARPROC *)&g_pfnSetProcessDefaultCpuSetMasks = GetProcAddress(hmod, "SetProcessDefaultCpuSetMasks"); /* W11 */ 474 479 if ( g_pfnSetThreadGroupAffinity 475 480 && g_pfnGetActiveProcessorCount … … 511 516 free(pInfo); 512 517 } 518 519 /* Iff this is windows 11 or later, the default policy should be that 520 threads can be scheduled in any CPU group, so reset any prior crap 521 to make sure this remains the case for us and our children. 522 523 This means we can skip g_pfnSetThreadGroupAffinity the calls later. */ 524 if (g_pfnSetProcessDefaultCpuSetMasks) 525 g_pfnSetProcessDefaultCpuSetMasks(GetCurrentProcess(), NULL, 0); 526 if (g_pfnSetThreadSelectedCpuSetMasks) 527 g_pfnSetThreadSelectedCpuSetMasks(GetCurrentThread(), NULL, 0); 513 528 514 529 MkWinChildInitCpuGroupAllocator(&g_ProcessorGroupAllocator); … … 1376 1391 */ 1377 1392 #ifdef MKWINCHILD_DO_SET_PROCESSOR_GROUP 1378 if (g_cProcessorGroups > 1 )1393 if (g_cProcessorGroups > 1 && !g_pfnSetProcessDefaultCpuSetMasks) 1379 1394 { 1380 1395 GROUP_AFFINITY Affinity = { 0, pWorker->iProcessorGroup, { 0, 0, 0 } }; … … 2596 2611 * the correct active processor mask. 2597 2612 */ 2598 if (g_cProcessorGroups > 1 )2613 if (g_cProcessorGroups > 1 && !g_pfnSetProcessDefaultCpuSetMasks) 2599 2614 { 2600 2615 BOOL fRet;
Note:
See TracChangeset
for help on using the changeset viewer.