GetSystemCpuSetInformation function

Allows an application to query the available CPU Sets on the system, and their current state.

Syntax

BOOL WINAPI GetSystemCpuSetInformation(
  _Out_opt_  PSYSTEM_CPU_SET_INFORMATION  Information,
  _In_       ULONG                        BufferLength,
  _Out_      PULONG                       ReturnedLength,
  _In_opt_   HANDLE                       Process,
  _Reserved_ ULONG                        Flags
);

Parameters

Information [out, optional]

A pointer to a SYSTEM_CPU_SET_INFORMATION structure that receives the CPU Set data. Pass NULL with a buffer length of 0 to determine the required buffer size.

BufferLength [in]

The length, in bytes, of the output buffer passed as the Information argument.

ReturnedLength [out]

The length, in bytes, of the valid data in the output buffer if the buffer is large enough, or the required size of the output buffer. If no CPU Sets exist, this value will be 0.

Process [in, optional]

An optional handle to a process. This process is used to determine the value of the AllocatedToTargetProcess flag in the SYSTEM_CPU_SET_INFORMATION structure. If a CPU Set is allocated to the specified process, the flag is set. Otherwise, it is clear. This handle must have the PROCESS_QUERY_LIMITED_INFORMATION access right. The value returned by GetCurrentProcess may also be specified here.

Flags

Reserved, must be 0.

Return value

If the API succeeds it returns TRUE. If it fails, the error reason is available through GetLastError. If the Information buffer was NULL or not large enough, the error code ERROR_INSUFFICIENT_BUFFER is returned. This API cannot fail when passed valid parameters and a buffer that is large enough to hold all of the return data.

Requirements

Requirement Value
Minimum supported client
Windows 10 [desktop apps | UWP apps]
Minimum supported server
Windows Server 2016 [desktop apps | UWP apps]
Header
Processthreadsapi.h
Library
Windows.h
DLL
Kernel32.dll