Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com>
---
Undocumented, but this is the name listed by Geoff Chappell and
elsewhere online.
dlls/kernel32/tests/thread.c | 22 +++++++++++-----------
dlls/kernelbase/thread.c | 6 +++---
dlls/ntdll/unix/thread.c | 4 ++--
dlls/wow64/process.c | 4 ++--
include/winternl.h | 2 +-
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
index f33e05741a2..b84f1eb2b6b 100644
--- a/dlls/kernel32/tests/thread.c
+++ b/dlls/kernel32/tests/thread.c
@@ -2378,7 +2378,7 @@ static void test_thread_description(void)
LocalFree(ptr);
len = 0;
- status = pNtQueryInformationThread(GetCurrentThread(), ThreadDescription, NULL, 0, &len);
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, 0, &len);
ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status);
ok(len == sizeof(*thread_desc), "Unexpected structure length %u.\n", len);
@@ -2386,7 +2386,7 @@ static void test_thread_description(void)
thread_desc->Description.Length = 1;
thread_desc->Description.MaximumLength = 0;
thread_desc->Description.Buffer = (WCHAR *)thread_desc;
- status = pNtQueryInformationThread(GetCurrentThread(), ThreadDescription, thread_desc, len, &len2);
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, len, &len2);
ok(!status, "Failed to get thread info, status %#x.\n", status);
ok(len2 == sizeof(*thread_desc), "Unexpected structure length %u.\n", len);
ok(!thread_desc->Description.Length, "Unexpected description length %#x.\n", thread_desc->Description.Length);
@@ -2406,12 +2406,12 @@ static void test_thread_description(void)
LocalFree(ptr);
len = 0;
- status = pNtQueryInformationThread(GetCurrentThread(), ThreadDescription, NULL, 0, &len);
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, 0, &len);
ok(status == STATUS_BUFFER_TOO_SMALL, "Failed to get thread info, status %#x.\n", status);
ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len);
len = 0;
- status = pNtQueryInformationThread(GetCurrentThread(), ThreadDescription, buff, sizeof(buff), &len);
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, buff, sizeof(buff), &len);
ok(!status, "Failed to get thread info.\n");
ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len);
@@ -2423,11 +2423,11 @@ static void test_thread_description(void)
/* Partial results. */
len = 0;
- status = pNtQueryInformationThread(GetCurrentThread(), ThreadDescription, NULL, 0, &len);
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, 0, &len);
ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status);
ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len);
- status = pNtQueryInformationThread(GetCurrentThread(), ThreadDescription, buff, len - sizeof(WCHAR), &len);
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadNameInformation, buff, len - sizeof(WCHAR), &len);
ok(status == STATUS_BUFFER_TOO_SMALL, "Unexpected status %#x.\n", status);
ok(len == sizeof(*thread_desc) + desc_len, "Unexpected structure length %u.\n", len);
@@ -2435,7 +2435,7 @@ static void test_thread_description(void)
thread_desc->Description.Length = thread_desc->Description.MaximumLength = 8;
lstrcpyW((WCHAR *)(thread_desc + 1), L"desc");
- status = pNtSetInformationThread(GetCurrentThread(), ThreadDescription, thread_desc, sizeof(*thread_desc));
+ status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc));
ok(status == STATUS_SUCCESS, "Failed to set thread description, status %#x.\n", status);
ptr = NULL;
@@ -2444,14 +2444,14 @@ static void test_thread_description(void)
ok(!lstrcmpW(ptr, L"desc"), "Unexpected description %s.\n", wine_dbgstr_w(ptr));
LocalFree(ptr);
- status = pNtSetInformationThread(GetCurrentThread(), ThreadDescription, thread_desc, sizeof(*thread_desc) - 1);
+ status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc) - 1);
ok(status == STATUS_INFO_LENGTH_MISMATCH, "Unexpected status %#x.\n", status);
- status = NtSetInformationThread(GetCurrentThread(), ThreadDescription, NULL, sizeof(*thread_desc));
+ status = NtSetInformationThread(GetCurrentThread(), ThreadNameInformation, NULL, sizeof(*thread_desc));
ok(status == STATUS_ACCESS_VIOLATION, "Unexpected status %#x.\n", status);
thread_desc->Description.Buffer = NULL;
- status = pNtSetInformationThread(GetCurrentThread(), ThreadDescription, thread_desc, sizeof(*thread_desc));
+ status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc));
ok(status == STATUS_ACCESS_VIOLATION, "Unexpected status %#x.\n", status);
hr = pSetThreadDescription(GetCurrentThread(), NULL);
@@ -2468,7 +2468,7 @@ static void test_thread_description(void)
ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to set thread description, hr %#x.\n", hr);
memset(thread_desc, 0, sizeof(*thread_desc));
- status = pNtSetInformationThread(GetCurrentThread(), ThreadDescription, thread_desc, sizeof(*thread_desc));
+ status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc));
ok(!status, "Failed to set thread description, status %#x.\n", status);
ptr = NULL;
diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c
index 9b97c4a8914..aa95fa0db15 100644
--- a/dlls/kernelbase/thread.c
+++ b/dlls/kernelbase/thread.c
@@ -430,7 +430,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription( HANDLE thread, PCWSTR des
info.Description.Length = info.Description.MaximumLength = length;
info.Description.Buffer = (WCHAR *)description;
- return HRESULT_FROM_NT(NtSetInformationThread( thread, ThreadDescription, &info, sizeof(info) ));
+ return HRESULT_FROM_NT(NtSetInformationThread( thread, ThreadNameInformation, &info, sizeof(info) ));
}
/***********************************************************************
@@ -447,14 +447,14 @@ HRESULT WINAPI DECLSPEC_HOTPATCH GetThreadDescription( HANDLE thread, WCHAR **de
*description = NULL;
length = 0;
- status = NtQueryInformationThread( thread, ThreadDescription, NULL, 0, &length );
+ status = NtQueryInformationThread( thread, ThreadNameInformation, NULL, 0, &length );
if (status != STATUS_BUFFER_TOO_SMALL)
return HRESULT_FROM_NT(status);
if (!(info = heap_alloc( length )))
return HRESULT_FROM_NT(STATUS_NO_MEMORY);
- status = NtQueryInformationThread( thread, ThreadDescription, info, length, &length );
+ status = NtQueryInformationThread( thread, ThreadNameInformation, info, length, &length );
if (!status)
{
if (!(*description = LocalAlloc( 0, info->Description.Length + sizeof(WCHAR))))
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index 57d355e96d2..2ccaaefa841 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -2035,7 +2035,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
SERVER_END_REQ;
return status;
- case ThreadDescription:
+ case ThreadNameInformation:
{
THREAD_DESCRIPTION_INFORMATION *info = data;
data_size_t len, desc_len = 0;
@@ -2228,7 +2228,7 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
return status;
}
- case ThreadDescription:
+ case ThreadNameInformation:
{
const THREAD_DESCRIPTION_INFORMATION *info = data;
diff --git a/dlls/wow64/process.c b/dlls/wow64/process.c
index fbe501ed034..676ed20f3f4 100644
--- a/dlls/wow64/process.c
+++ b/dlls/wow64/process.c
@@ -930,7 +930,7 @@ NTSTATUS WINAPI wow64_NtQueryInformationThread( UINT *args )
return status;
}
- case ThreadDescription: /* THREAD_DESCRIPTION_INFORMATION */
+ case ThreadNameInformation: /* THREAD_DESCRIPTION_INFORMATION */
{
THREAD_DESCRIPTION_INFORMATION *info;
THREAD_DESCRIPTION_INFORMATION32 *info32 = ptr;
@@ -1186,7 +1186,7 @@ NTSTATUS WINAPI wow64_NtSetInformationThread( UINT *args )
}
else return STATUS_INVALID_PARAMETER;
- case ThreadDescription: /* THREAD_DESCRIPTION_INFORMATION */
+ case ThreadNameInformation: /* THREAD_DESCRIPTION_INFORMATION */
if (len == sizeof(THREAD_DESCRIPTION_INFORMATION32))
{
THREAD_DESCRIPTION_INFORMATION32 *info32 = ptr;
diff --git a/include/winternl.h b/include/winternl.h
index 5c2a1c07aeb..b07a259765a 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1869,7 +1869,7 @@ typedef enum _THREADINFOCLASS {
ThreadCounterProfiling,
ThreadIdealProcessorEx,
ThreadSuspendCount = 35,
- ThreadDescription = 38,
+ ThreadNameInformation = 38,
MaxThreadInfoClass
} THREADINFOCLASS;
--
2.30.1 (Apple Git-130)