UID | tech.root | title | ms.date | ms.topic | targetos | description | req.assembly | req.construct-type | req.ddi-compliance | req.dll | req.header | req.idl | req.include-header | req.irql | req.kmdf-ver | req.lib | req.max-support | req.namespace | req.redist | req.target-min-winverclnt | req.target-min-winversvr | req.target-type | req.type-library | req.umdf-ver | req.unicode-ansi | topic_type | api_type | api_location | api_name | f1_keywords | helpviewer_keywords | dev_langs | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:processthreadsapi.GetThreadSelectedCpuSetMasks |
processthreadsapi |
GetThreadSelectedCpuSetMasks |
03/12/2021 |
language-reference |
Windows |
Returns the explicit CPU Set assignment of the specified thread, if any assignment was set using SetThreadSelectedCpuSetMasks or SetThreadSelectedCpuSets. |
function |
kernel32.dll |
processthreadsapi.h |
Windows 11 |
Windows Server 2022 |
|
|
|
|
|
|
|
Returns the explicit CPU Set assignment of the specified thread, if any assignment was set using SetThreadSelectedCpuSetMasks or SetThreadSelectedCpuSets.
Specifies the thread for which to query the selected CPU Sets. This handle must have the PROCESS_QUERY_LIMITED_INFORMATION access right. The value returned by GetCurrentProcess can also be specified here.
Specifies an optional buffer to retrieve a list of GROUP_AFFINITY structures representing the thread selected CPU Sets.
Specifies the size of the CpuSetMasks array, in elements.
On successful return, specifies the number of affinity structures written to the array. If the array is too small, the function fails with ERROR_INSUFFICIENT_BUFFER and sets the RequiredMaskCount parameter to the number of elements required. The number of required elements is always less than or equal to the maximum group count returned by GetMaximumProcessorGroupCount.
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.
If the array supplied is too small, the error value is ERROR_INSUFFICIENT_BUFFER and the RequiredMaskCount is set to the number of elements required.
If no explicit assignment is set, RequiredMaskCount is set to 0 and the function succeeds.
This function is analogous to GetThreadSelectedCpuSets, except that it uses group affinities as opposed to CPU Set IDs to represent a list of CPU sets. This means that the thread selected CPU Sets are mapped to their home processors, and those processors are retrieved in the resulting list of group affinities.