Reputation: 6890
The process is not running as WOW64, its running as x64 in an x64 environment. the code is as follows
DWORD64 dwProcessAffinity, dwSystemAffinity;
GetProcessAffinityMask(GetCurrentProcess(), &dwProcessAffinity, &dwSystemAffinity);
As confirmation IsWow64 is returning false. The environment created has the number of processors more than a hundred.
Upvotes: 0
Views: 5095
Reputation: 2813
The return value of GetProcessAffinityMask is a BOOL, so if the call has returned TRUE, then the call has succeeded. There are two masks, one for the process affinity and another for the system affinity. Each bit in the mask corresponds to a processor. For example, the mask 0x10 means processor 4 and the mask 0x03 means processors 0 and 1. A mask of -1 (0xffffffffffffffff) has 64 bits set, one for each processor 0 through 63. By using a DWORD_PTR (and not a DWORD64), there was probably an attempt (by the original developers) to ensure later programmers view the result as a unsigned hex sequence and not as a signed integer, and furthermore this type results in sizing the mask appropriately (see next paragraph).
When Windows 2003 was being developed, it was exceedingly rare to have a system of even 32 processors, so placing the limit of 32 (for 32-bit versions) and 64 (for 64-bit versions) was reasonable. Even in the 2008 timeframe, there were still debates about raising the processor limit for Windows 2008 R2, which now supports 256, but could go higher. Running Windows 2003 is using technology that is a decade old, so one can expect some limitations regarding what were new technologies at the time.
Hyperthreading (HT) is an interesting technology. There is some benefit to adding the additional hardware to support another logical thread. Understand that for the OS, there is no distinguishing between the two logical processors, in that one cannot say X is the physical processor and Y is the HT "add-on". The hardware treats X and Y as equal partners to the shared resources, and so the OS sees them equally.
As the final uncertainty into your situation, I cannot tell you what subset of the 80 logical processors that Windows 2003 will be using. It might take 32 HT pairs or it might take the physical 40 and include 24 logical HT units. You could help answer that by running GetLogicalProcessorInformation.
Upvotes: 3