1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

format the code

This commit is contained in:
xyz1001 2023-09-08 19:55:55 +08:00
parent 263f378afc
commit 05e3905742

View File

@ -213,24 +213,24 @@ TRACY_API const char* GetThreadName( uint32_t id )
# else # else
static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" ); static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
# endif # endif
if( _GetThreadDescription ) if( _GetThreadDescription )
{ {
auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id ); auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id );
if( hnd != 0 ) if( hnd != 0 )
{ {
PWSTR tmp; PWSTR tmp;
if ( SUCCEEDED( _GetThreadDescription( hnd, &tmp ) ) ) if ( SUCCEEDED( _GetThreadDescription( hnd, &tmp ) ) )
{
auto ret = wcstombs( buf, tmp, 256 );
CloseHandle( hnd );
LocalFree( tmp );
if( ret != static_cast<std::size_t>(-1) )
{ {
return buf; auto ret = wcstombs( buf, tmp, 256 );
CloseHandle( hnd );
LocalFree( tmp );
if( ret != static_cast<std::size_t>( -1 ) )
{
return buf;
}
} }
} }
} }
}
#elif defined __linux__ #elif defined __linux__
int cs, fd; int cs, fd;
char path[32]; char path[32];