Check if GetThreadDescription() is supported.

This functionality is available since Win 10 1607.
This commit is contained in:
Bartosz Taudul 2021-05-04 16:13:42 +02:00
parent 402d749d13
commit a6c6943a6c
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
1 changed files with 11 additions and 8 deletions

View File

@ -485,6 +485,8 @@ void SysTraceSendExternalName( uint64_t thread )
hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, DWORD( thread ) );
}
if( hnd != 0 )
{
if( _GetThreadDescription )
{
PWSTR tmp;
_GetThreadDescription( hnd, &tmp );
@ -498,6 +500,7 @@ void SysTraceSendExternalName( uint64_t thread )
threadSent = true;
}
}
}
const auto pid = GetProcessIdOfThread( hnd );
if( !threadSent && NtQueryInformationThread && _EnumProcessModules && _GetModuleInformation && _GetModuleBaseNameA )
{