Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 3.05 KB

nf-processthreadsapi-getthreaddescription.md

File metadata and controls

99 lines (76 loc) · 3.05 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:processthreadsapi.GetThreadDescription
GetThreadDescription function (processthreadsapi.h)
Retrieves the description that was assigned to a thread by calling SetThreadDescription.
GetThreadDescription
GetThreadDescription function
base.getthreaddescription
processthreadsapi/GetThreadDescription
base\getthreaddescription.htm
processthreadsapi
9CFF0A2D-2196-4AE0-8F77-229A8AB7A3E8
12/05/2018
GetThreadDescription, GetThreadDescription function, base.getthreaddescription, processthreadsapi/GetThreadDescription
processthreadsapi.h
Windows
Windows 10, version 1607 [desktop apps \| UWP apps]
Windows Server 2016 [desktop apps \| UWP apps]
Kernel32.lib
Kernel32.dll
Windows
19H1
GetThreadDescription
processthreadsapi/GetThreadDescription
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
Kernelbase.dll
Api-ms-win-core-processthreads-l1-1-3.dll
GetThreadDescription

GetThreadDescription function

-description

Retrieves the description that was assigned to a thread by calling SetThreadDescription.

-parameters

-param hThread [in]

A handle to the thread for which to retrieve the description. The handle must have THREAD_QUERY_LIMITED_INFORMATION access.

-param ppszThreadDescription [out]

A Unicode string that contains the description of the thread.

-returns

If the function succeeds, the return value is the HRESULT that denotes a successful operation. If the function fails, the return value is an HRESULT that denotes the error.

-remarks

Windows Server 2016, Windows 10 LTSB 2016 and Windows 10 version 1607: GetThreadDescription is only available by Run Time Dynamic Linking in KernelBase.dll.

The description for a thread can change at any time. For example, a different thread can change the description of a thread of interest while you try to retrieve that description.

Thread descriptions do not need to be unique.

To free the memory for the thread description, call the LocalFree method.

Examples

The following example gets the description for a thread, prints the description, and then frees the memory for the description.

HRESULT hr = GetThreadDescription(ThreadHandle, &data);
if (SUCCEEDED(hr))
{   
    wprintf(L"%ls\n", data);
    LocalFree(data);
}

-see-also

LocalFree, SetThreadDescription