ReactOS 0.4.16-dev-1946-g52006dd
SetThreadDescription.c
Go to the documentation of this file.
1
2#include "k32_vista.h"
3#define NDEBUG
4#include <debug.h>
5
6#undef TRACE
7#define TRACE DPRINT
8
9/***********************************************************************
10 * SetThreadDescription (kernelbase.@)
11 */
13{
15 int length;
16
17 TRACE( "(%p, %s)\n", thread, debugstr_w( description ));
18
19 length = description ? lstrlenW( description ) * sizeof(WCHAR) : 0;
20
21 if (length > USHRT_MAX)
23
24 info.ThreadName.Length = info.ThreadName.MaximumLength = length;
25 info.ThreadName.Buffer = (WCHAR *)description;
26
28}
HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription(HANDLE thread, PCWSTR description)
#define TRACE
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:240
static HANDLE thread
Definition: service.c:33
#define lstrlenW
Definition: compat.h:750
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define USHRT_MAX
Definition: limits.h:38
@ ThreadNameInformation
Definition: winternl.h:2319
#define debugstr_w
Definition: kernel32.h:32
NTSTATUS NTAPI NtSetInformationThread(_In_ HANDLE ThreadHandle, _In_ THREADINFOCLASS ThreadInformationClass, _In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation, _In_ ULONG ThreadInformationLength)
Definition: query.c:2268
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define WINAPI
Definition: msvc.h:6
const char * description
Definition: directx.c:2497
#define HRESULT_FROM_NT(x)
Definition: winerror.h:216
__wchar_t WCHAR
Definition: xmlstorage.h:180