[*] Don't warn on XP/Vista

This commit is contained in:
Reece Wilson 2023-08-23 17:09:19 +01:00
parent 921fee1b8d
commit 9c04b31da3

View File

@ -1032,7 +1032,22 @@ namespace Aurora::Threading::Threads
}
}
SetThreadAffinityMask(this->handle_, mask.lower);
if (mask.CpuBitCount() <= 32)
{
DWORD_PTR uProcMask {};
DWORD_PTR uSysMask {};
AuUInt32 uProcmask { mask.lower };
if (::GetProcessAffinityMask(GetCurrentProcess(), &uProcMask, &uSysMask))
{
uProcmask &= uProcMask;
}
if (::SetThreadAffinityMask(this->handle_, uProcmask))
{
return;
}
}
#endif
SysPushErrorUnavailableError("Couldn't set thread affinity");