GetLogicalProcessorInformation

GetLogicalProcessorInformation retrieves information about logical processors and related hardware.

Syntax

Copy
BOOL GetLogicalProcessorInformation(
  [out]     PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer,
  [in, out] PDWORD ReturnedLength
);

Parameters

[out] Buffer

A pointer to a buffer that receives an array of SYSTEM_LOGICAL_PROCESSOR_INFORMATION structures. If the function fails, the contents of this buffer are undefined.

[in, out] ReturnedLength

On input, this parameter specifies the length of the buffer pointed to by Buffer, in bytes. If the buffer is large enough to contain all the data, this function succeeds and ReturnedLength is set to the number of bytes returned. If the buffer is not large enough to contain all the data, the function fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and ReturnedLength is set to the buffer length required to contain all the data. If the function fails with an error other than ERROR_INSUFFICIENT_BUFFER, the value of ReturnedLength is undefined.

Return Value

If the function succeeds, it returns TRUE and at least one SYSTEM_LOGICAL_PROCESSOR_INFORMATION structure is written to the output buffer. If the function fails, it returns FALSE. To get extended error information, call GetLastError.

Possible error codes:

Error code Meaning

ERROR_INSUFFICIENT_BUFFER

The buffer is not large enough to contain all the data

Remarks

You can use GetLogicalProcessorInformation to get information about the relationship between logical processors in the system. Your application can use this information when affining threads and processes to take advantage of the platform’s hardware properties, or to determine the number of logical and physical processors.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

windows.h

wRTOS_rtss.lib

See also: