GetThreadInformation function (processthreadsapi.h)

Retrieves information about the specified thread.

Syntax

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

Parameters

[in] hThread

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

[in] ThreadInformationClass

The class of information to retrieve. This value can be ThreadMemoryPriority, ThreadAbsoluteCpuPriority or ThreadDynamicCodePolicy.

Note

ThreadDynamicCodePolicy is supported in Windows Server 2016 and newer, Windows 10 LTSB 2016 and newer, and Windows 10 version 1607 and newer.

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 ThreadAbsoluteCpuPriority, this parameter must point to a LONG.

If the ThreadInformationClass parameter is ThreadDynamicCodePolicy, this parameter must point to a DWORD.

[in] 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 ThreadAbsoluteCpuPriority, this parameter must be sizeof(LONG).

If the ThreadInformationClass parameter is ThreadDynamicCodePolicy, this parameter must be sizeof(DWORD).

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

Requirement Value
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