From 1b9d48a7b01e2b715af46bc1f8d5fe6f1529782c Mon Sep 17 00:00:00 2001 From: Brendan Shanks Date: Thu, 3 Mar 2022 11:50:56 -0800 Subject: [PATCH] ntdll: Don't require equal Length and MaximumLength when setting ThreadNameInformation. Signed-off-by: Brendan Shanks Signed-off-by: Alexandre Julliard --- dlls/kernel32/tests/thread.c | 2 -- dlls/ntdll/unix/thread.c | 1 - 2 files changed, 3 deletions(-) diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index bcdda77c553..3cf58d928ae 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -2493,13 +2493,11 @@ static void test_thread_description(void) RtlInitUnicodeString(&thread_desc->ThreadName, (WCHAR *)(thread_desc + 1)); status = pNtSetInformationThread(GetCurrentThread(), ThreadNameInformation, thread_desc, sizeof(*thread_desc)); - todo_wine ok(status == STATUS_SUCCESS, "Failed to set thread description, status %#x.\n", status); ptr = NULL; hr = pGetThreadDescription(GetCurrentThread(), &ptr); ok(hr == HRESULT_FROM_NT(STATUS_SUCCESS), "Failed to get thread description, hr %#x.\n", hr); - todo_wine ok(!lstrcmpW(ptr, L"desc"), "Unexpected description %s.\n", wine_dbgstr_w(ptr)); LocalFree(ptr); diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c index 0488129aa4c..b8546edde87 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -2237,7 +2237,6 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, if (length != sizeof(*info)) return STATUS_INFO_LENGTH_MISMATCH; if (!info) return STATUS_ACCESS_VIOLATION; - if (info->ThreadName.Length != info->ThreadName.MaximumLength) return STATUS_INVALID_PARAMETER; if (info->ThreadName.Length && !info->ThreadName.Buffer) return STATUS_ACCESS_VIOLATION; SERVER_START_REQ( set_thread_info )