ntdll: Rename ThreadDescription to ThreadNameInformation.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2021-12-02 09:19:06 -08:00 committed by Alexandre Julliard
parent 3867d253ed
commit 65dd060a67
5 changed files with 19 additions and 19 deletions

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -934,7 +934,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;
@ -1190,7 +1190,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;

View File

@ -1870,7 +1870,7 @@ typedef enum _THREADINFOCLASS {
ThreadCounterProfiling,
ThreadIdealProcessorEx,
ThreadSuspendCount = 35,
ThreadDescription = 38,
ThreadNameInformation = 38,
MaxThreadInfoClass
} THREADINFOCLASS;