System uses Create{Remote}Thread
instead of _beginthread
for callbacks like ServiceMain, RegisterServiceCtrlHandlerEx
, HandlerRoutine (SetConsoleCtrlHandler
), etc. Does it mean that it is unsafe to call statically linked CRT from these threads?
In modern (UCRT based) runtime _beginthread{ex}
doesn't do any initialization. It only provide minor services like preventing module from unloading while thread is running and optionally initialize WinRT (RoInitialize
).