EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

GetThreadInformation function

Retrieves information about the specified thread.

Syntax


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

Parameters

hThread [in]

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

ThreadInformationClass [in]

The class of information to retrieve. The only supported value is ThreadMemoryPriority.

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.

ThreadInformationSize [in]

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).

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.

Examples

    DWORD ErrorCode;
    BOOL Success;
    MEMORY_PRIORITY_INFORMATION MemPrio;

    //
    // Query thread memory priority.
    //

    Success = GetThreadInformation(GetCurrentThread(),
                                   ThreadMemoryPriority,
                                   &MemPrio,
                                   sizeof(MemPrio));

    if (!Success) {
        ErrorCode = GetLastError();
        fprintf(stderr, "Get thread memory priority failed: %d\n", ErrorCode);
    } else {
        printf("Current thread memory priority is %d.\n", MemPrio.MemoryPriority);
    }

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

GetProcessInformation
SetThreadInformation

 

 

Contribuições da comunidade

ADICIONAR
Mostrar:
© 2014 Microsoft