Which functions are called prior to DllMain()? If more than one during the C runtime initialization, then the order is important.
From the source:-
If your DLL is linked with the C run-time library (CRT), the entry point provided by the CRT calls the constructors and destructors for global and static C++ objects. Therefore, these restrictions for DllMain also apply to constructors and destructors and any code that is called from them.
I think only _DllMainCRTStartup() is called, which in turns calls all constructors of global C++ objects (none in the case of C) and (I'm not sure of that last one) calls DllMain().
Of course, it also calls some Kernel32 functions to initialize the CRT (for starters, it needs to allocate some memory and a TLS slot).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With