ntdll: Don't require equal Length and MaximumLength when setting ThreadNameInformation.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2022-03-03 11:50:56 -08:00 committed by Alexandre Julliard
parent a9a294d286
commit 1b9d48a7b0
2 changed files with 0 additions and 3 deletions

View file

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

View file

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