ntdll: Fix calculation of process and thread affinity masks on systems with a large number of processors.

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jan 15 06:00:32 CST 2015


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



More information about the wine-devel mailing list