From 78127dc3578c35b2411c2124b7f615889bbae9b9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 25 Aug 2019 00:33:22 +0200 Subject: [PATCH] System threads only allow limited information queries. --- client/TracySysTrace.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index 65ff8193..bc98baa1 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -207,7 +207,11 @@ t_GetModuleBaseNameA _GetModuleBaseNameA = (t_GetModuleBaseNameA)GetProcAddress( void SysTraceSendExternalName( uint64_t thread ) { bool threadSent = false; - const auto hnd = OpenThread( THREAD_QUERY_INFORMATION, FALSE, DWORD( thread ) ); + auto hnd = OpenThread( THREAD_QUERY_INFORMATION, FALSE, DWORD( thread ) ); + if( hnd == 0 ) + { + hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, DWORD( thread ) ); + } if( hnd != 0 ) { #if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2