GetThreadInformation function

Retrieves information about the specified thread.

Syntax

BOOL GetThreadInformation(
  HANDLE                   hThread,
  THREAD_INFORMATION_CLASS ThreadInformationClass,
  LPVOID                   ThreadInformation,
  DWORD                    ThreadInformationSize
);

Parameters

hThread

A handle to the thread. The handle must have THREAD_QUERY_INFORMATION access rights. For more information, see Thread Security and Access Rights.

ThreadInformationClass

The class of information to retrieve. The only supported values are ThreadMemoryPriority and ThreadPowerThrottling.

ThreadInformation

Pointer to a structure to receive the type of information specified by the ThreadInformationClass parameter.

If the ThreadInformationClass parameter is ThreadMemoryPriority, this parameter must point to a MEMORY_PRIORITY_INFORMATION structure.

If the ThreadInformationClass parameter is ThreadPowerThrottling, this parameter must point to a THREAD_POWER_THROTTLING_STATE structure.

ThreadInformationSize

The size in bytes of the structure specified by the ThreadInformation parameter.

If the ThreadInformationClass parameter is ThreadMemoryPriority, this parameter must be sizeof(MEMORY_PRIORITY_INFORMATION).

If the ThreadInformationClass parameter is ThreadPowerThrottling, this parameter must be sizeof(THREAD_POWER_THROTTLING_STATE).

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header processthreadsapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

GetProcessInformation

SetThreadInformation