//
// __vcrt_freeptd from 0x180124ddc to 0x180124e29 (77 bytes)
//
// 2 xrefs:
// > __vcrt_thread_detach @ 0x180124b76
// > ??> @ 0x180202738
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall _vcrt_freeptd(void *Block)
{
DWORD v2; // ecx
void *Value; // rax
v2 = dwTlsIndex;
if ( dwTlsIndex != -1 )
{
if ( !Block )
{
Value = (void *)_vcrt_FlsGetValue();
v2 = dwTlsIndex;
Block = Value;
}
_vcrt_FlsSetValue(v2, nullptr);
if ( Block )
{
if ( Block != &unk_1801F4A70 )
free(Block);
}
}
}