On 15 Jan 2015, at 12:44, Hans Leidekker wrote:
- const DWORD shift = min(NtCurrentTeb()->Peb-
NumberOfProcessors, sizeof(DWORD_PTR) * 8);
- const DWORD_PTR mask = (1 << shift) - 1;
Note that this will result in a mask of 0 on i386 if NumberOfProcessors >= 32 (and on x86-64 if NumberProcessors >= 64). (1 << 32) == 1 on Intel if calculated as a 32 bit operation, and similarly (1 << 64) == 1 on 64 bit.
Jonas