SetThreadAffinityMask
sets the affinity of a THREAD not of the whole process. If you check the return value you should see that SetThreadAffinityMask
is failing. To get the current thread use GetCurrentThread()
not GetCurrentProcess()
.
i.e. change your code to
SetThreadAffinityMask(GetCurrentThread(),1)
If you want to set the affinity of the whole process use
SetProcessAffinityMask(GetCurrentProcess(),1)