Commit f726b6ba authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

ntdll: Print correct thread rename trace if non-pseudo-handle to current thread is used.

parent 0c38bb0b
......@@ -2282,9 +2282,10 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
if (!info) return STATUS_ACCESS_VIOLATION;
if (info->ThreadName.Length && !info->ThreadName.Buffer) return STATUS_ACCESS_VIOLATION;
if (handle == GetCurrentThread())
status = NtQueryInformationThread( handle, ThreadBasicInformation, &tbi, sizeof(tbi), NULL );
if (handle == GetCurrentThread() || (!status && (HandleToULong(tbi.ClientId.UniqueThread) == GetCurrentThreadId())))
WARN_(threadname)( "Thread renamed to %s\n", debugstr_us(&info->ThreadName) );
else if (!NtQueryInformationThread( handle, ThreadBasicInformation, &tbi, sizeof(tbi), NULL ))
else if (!status)
WARN_(threadname)( "Thread ID %04x renamed to %s\n", HandleToULong( tbi.ClientId.UniqueThread ), debugstr_us(&info->ThreadName) );
else
WARN_(threadname)( "Thread handle %p renamed to %s\n", handle, debugstr_us(&info->ThreadName) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment