SetThreadSelectedCpuSetMasks function (processthreadsapi.h)
Sets the selected CPU Sets assignment for the specified thread. This assignment overrides the process default assignment, if one is set.
Syntax
BOOL SetThreadSelectedCpuSetMasks(
HANDLE Thread,
PGROUP_AFFINITY CpuSetMasks,
USHORT CpuSetMaskCount
);
Parameters
Thread
Specifies the thread on which to set the CPU Set assignment. PROCESS_SET_LIMITED_INFORMATION access right. The value returned by GetCurrentProcess can also be specified here.
CpuSetMasks
Specifies an optional buffer of GROUP_AFFINITY structures representing the CPU Sets to set as the thread selected CPU set. If this is NULL, the SetThreadSelectedCpuSetMasks function clears out any assignment, reverting to process default assignment if one is set.
CpuSetMaskCount
Specifies the number of GROUP_AFFINITY structures in the list passed in the GroupCpuSets argument. If the buffer is NULL, this value must be zero.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero and extended error information can be retrieved by calling GetLastError.
Remarks
This function is analogous to SetThreadSelectedCpuSets, except that it uses group affinities as opposed to CPU Set IDs to represent a list of CPU sets. This means that the resulting thread selected CPU Set assignment is the set of all CPU sets with a home processor in the provided list of group affinities.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 11 |
Minimum supported server | Windows Server 2022 |
Header | processthreadsapi.h |
DLL | kernel32.dll |