SetProcessDefaultCpuSetMasks function (processthreadsapi.h)

Sets the default CPU Sets assignment for threads in the specified process.


BOOL SetProcessDefaultCpuSetMasks(
  HANDLE          Process,
  USHORT          CpuSetMaskCount



Specifies the process for which to set the default CPU Sets. This handle must have the PROCESS_SET_LIMITED_INFORMATION access right. The value returned by GetCurrentProcess can also be specified here.


Specifies an optional buffer of GROUP_AFFINITY structures representing the CPU Sets to set as the process default CPU set. If this is NULL, the SetProcessDefaultCpuSetMasks function clears out any assignment.


Specifies the size of the CpuSetMasks array, in elements. If the buffer is NULL, this value must be zero.

Return value

This function cannot fail when passed valid parameters.


Threads belonging to this process which don’t have CPU Sets explicitly set using SetThreadSelectedCpuSetMasks or SetThreadSelectedCpuSets, will inherit the sets specified by SetProcessDefaultCpuSetMasks automatically.

This function is analogous to SetProcessDefaultCpuSets, except that it uses group affinities as opposed to CPU Set IDs to represent a list of CPU sets. This means that the resulting process default CPU Set assignment is the set of all CPU sets with a home processor in the provided list of group affinities.


Minimum supported client Windows 11
Minimum supported server Windows Server 2022
Header processthreadsapi.h
DLL kernel32.dll