GetNumaNodeProcessorMask function

Retrieves the processor mask for the specified node.

Use the GetNumaNodeProcessorMaskEx function to retrieve the processor mask for a node in any processor group.


BOOL GetNumaNodeProcessorMask(
  UCHAR      Node,
  PULONGLONG ProcessorMask



The number of the node.


The processor mask for the node. A processor mask is a bit vector in which each bit represents a processor and whether it is in the node.

If the node has no processors configured, the processor mask is zero.

On systems with more than 64 processors, this parameter is set to the processor mask for the node only if the node is in the same processor group as the calling thread. Otherwise, the parameter is set to zero.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


To retrieve the highest numbered node in the system, use the GetNumaHighestNodeNumber function. Note that this number is not guaranteed to equal the total number of nodes in the system.

To ensure that all threads for your process run on the same node, use the SetProcessAffinityMask function with a process affinity mask that specifies processors in the same node.


Minimum supported client Windows Vista, Windows XP Professional x64 Edition, Windows XP with SP2 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also



NUMA Support

Process and Thread Functions