GetThreadSelectedCpuSets function (processthreadsapi.h)

Returns the explicit CPU Set assignment of the specified thread, if any assignment was set using the SetThreadSelectedCpuSets API. If no explicit assignment is set, RequiredIdCount is set to 0 and the function returns TRUE.

Syntax

BOOL GetThreadSelectedCpuSets(
  HANDLE Thread,
  PULONG CpuSetIds,
  ULONG  CpuSetIdCount,
  PULONG RequiredIdCount
);

Parameters

Thread

Specifies the thread for which to query the selected CPU Sets. This handle must have the THREAD_QUERY_LIMITED_INFORMATION access right. The value returned by GetCurrentThread can also be specified here.

CpuSetIds

Specifies an optional buffer to retrieve the list of CPU Set identifiers.

CpuSetIdCount

Specifies the capacity of the buffer specified in CpuSetIds. If the buffer is NULL, this must be 0.

RequiredIdCount

Specifies the required capacity of the buffer to hold the entire list of thread selected CPU Sets. On successful return, this specifies the number of IDs filled into the buffer.

Return value

This API returns TRUE on success. If the buffer is not large enough, the GetLastError value is ERROR_INSUFFICIENT_BUFFER. This API cannot fail when passed valid parameters and the return buffer is large enough.

Requirements

Requirement Value
Minimum supported client Windows 10
Minimum supported server Windows Server 2016
Header processthreadsapi.h
DLL kernel32.dll