MCPcopy Create free account
hub / github.com/SpecialKO/SpecialK / GetCurrentThreadDescription

Function GetCurrentThreadDescription

src/thread.cpp:334–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334HRESULT
335WINAPI
336GetCurrentThreadDescription (_Out_ PWSTR *threadDescription)
337{
338 SK_TLS* pTLS = //= ReadAcquire (&__SK_DLL_Attached) ?
339 SK_TLS_Bottom (); //: nullptr;
340
341 // Always use the TLS value if there is one
342 if ( pTLS != nullptr &&
343 *pTLS->debug.name != L'\0' )
344 {
345 // This is not freed here; the caller is expected to free it!
346 *threadDescription =
347 (wchar_t *)SK_LocalAlloc (LPTR, sizeof (wchar_t) * SK_MAX_THREAD_NAME_LEN);
348
349 wcsncpy_s (
350 *threadDescription, SK_MAX_THREAD_NAME_LEN-1,
351 pTLS->debug.name, _TRUNCATE
352 );
353
354 return S_OK;
355 }
356
357 return
358 SK_GetThreadDescription ( GetCurrentThread (),
359 threadDescription );
360}
361
362 using RtlEnterCriticalSection_pfn = NTSTATUS (WINAPI *)(PRTL_CRITICAL_SECTION);
363 RtlEnterCriticalSection_pfn

Callers 2

SK_FrameCallbackFunction · 0.85
crash_handler.cppFile · 0.85

Calls 3

SK_TLS_BottomFunction · 0.85
SK_LocalAllocFunction · 0.85
SK_GetThreadDescriptionFunction · 0.85

Tested by

no test coverage detected