//
// __scrt_initialize_thread_safe_statics from 0x180120824 to 0x1801208f4 (208 bytes)
//
// 2 xrefs:
// > ??> @ 0x180144518
// > ??> @ 0x180202528
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:54:52 +0000
//
__int64 __fastcall __scrt_initialize_thread_safe_statics()
{
HMODULE ModuleHandleW; // rbx
BOOL (__stdcall *SleepConditionVariableCS)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD); // rdi
void (__stdcall *WakeAllConditionVariable)(PCONDITION_VARIABLE); // rax
InitializeCriticalSectionAndSpinCount(&stru_1801F49F0, 0xFA0u);
ModuleHandleW = GetModuleHandleW(L"api-ms-win-core-synch-l1-2-0.dll");
if ( !ModuleHandleW )
{
ModuleHandleW = GetModuleHandleW(L"kernel32.dll");
if ( !ModuleHandleW )
goto LABEL_9;
}
SleepConditionVariableCS = (BOOL (__stdcall *)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD))GetProcAddress(
ModuleHandleW,
"SleepConditionVariableCS");
WakeAllConditionVariable = (void (__stdcall *)(PCONDITION_VARIABLE))GetProcAddress(
ModuleHandleW,
"WakeAllConditionVariable");
if ( SleepConditionVariableCS && WakeAllConditionVariable )
{
qword_1801F4A18 = (__int64)SleepConditionVariableCS;
qword_1801F4A20 = (__int64)WakeAllConditionVariable;
}
else
{
hHandle = CreateEventW(nullptr, 1, 0, nullptr);
if ( !hHandle )
goto LABEL_9;
}
if ( !_scrt_initialize_onexit_tables(0) )
{
LABEL_9:
_scrt_fastfail(7);
__debugbreak();
}
atexit(__scrt_uninitialize_thread_safe_statics);
return 0;
}