System threads only allow limited information queries.

This commit is contained in:
Bartosz Taudul 2019-08-25 00:33:22 +02:00
parent e5a11ad593
commit 78127dc357

View File

@ -207,7 +207,11 @@ t_GetModuleBaseNameA _GetModuleBaseNameA = (t_GetModuleBaseNameA)GetProcAddress(
void SysTraceSendExternalName( uint64_t thread ) void SysTraceSendExternalName( uint64_t thread )
{ {
bool threadSent = false; 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( hnd != 0 )
{ {
#if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2 #if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2