[PATCH 1/2] kernelbase: Use +threadname channel for SetThreadDescription().

Brendan Shanks wine at gitlab.winehq.org
Wed May 18 17:00:39 CDT 2022


From: Brendan Shanks <bshanks at codeweavers.com>

Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
---
 dlls/kernelbase/thread.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/kernelbase/thread.c b/dlls/kernelbase/thread.c
index 6ba58cf0a67..c7c411a9e0a 100644
--- a/dlls/kernelbase/thread.c
+++ b/dlls/kernelbase/thread.c
@@ -37,6 +37,7 @@
 #include "wine/heap.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(thread);
+WINE_DECLARE_DEBUG_CHANNEL(threadname);
 
 
 /***********************************************************************
@@ -420,7 +421,10 @@ HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription( HANDLE thread, PCWSTR des
     THREAD_NAME_INFORMATION info;
     int length;
 
-    TRACE( "(%p, %s)\n", thread, debugstr_w( description ));
+    if (thread == GetCurrentThread())
+        WARN_(threadname)( "Thread renamed to %s\n", debugstr_w( description ));
+    else
+        WARN_(threadname)( "Thread handle %p renamed to %s\n", thread, debugstr_w( description ));
 
     length = description ? lstrlenW( description ) * sizeof(WCHAR) : 0;
 
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/89



More information about the wine-devel mailing list