GetThreadIdealProcessorEx function (processthreadsapi.h)

Retrieves the processor number of the ideal processor for the specified thread.

Syntax

BOOL GetThreadIdealProcessorEx(
  [in]  HANDLE            hThread,
  [out] PPROCESSOR_NUMBER lpIdealProcessor
);

Parameters

[in] hThread

A handle to the thread for which to retrieve the ideal processor. This handle must have been created with the THREAD_QUERY_LIMITED_INFORMATION access right. For more information, see Thread Security and Access Rights.

[out] lpIdealProcessor

Points to PROCESSOR_NUMBER structure to receive the number of the ideal processor.

Return value

If the function succeeds, it returns a nonzero value.

If the function fails, it returns zero. To get extended error information, use GetLastError.

Remarks

To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header processthreadsapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

SetThreadIdealProcessorEx