I have a situation where my Windows autostart Service application is explicitly loading and calling a startup routine in a "parent" DLL1.DLL (using LoadLibrary/GetProcAddress - no import libraries). The startup routine in the "parent" DLL is in turn explicitly loading several "child" DLLs: DLL2, DLL3 and DLL4. There are no LoadLibrary calls in any DLLMain routines. The Service executable and all the DLLs are developed in C.
On Windows 7 this all works fine, but on Windows 10 the service is randomly hanging in Start Pending after reboot. Debug output shows that it is not returning from the LoadLibrary where the parent DLL1 is loading one of the child DLLs. Debug output is also showing that the DLLMain routine of the child DLL is not even being called.
All of the DLLMain routines are very simple. All they do is InitializeCriticalSection if ul_reason_for_call == 0. They do nothing funcky like calling LoadLibrary inside DLLMain.
I have read several articles/threads about the Windows 10 Thread Pool such as this and this.
From my understanding, Windows 10 multithreads the loading of implicit LoadLibrary (ie, via Import Library). But does it also multithread the loading of explicit LoadLibrary? For example, might child DLL2 still be loading while child DLL3 is starting to load?
Since this is a random thing it must clearly be a timing and/or thread issue. Any suggestions would be greatly appreciated. I've spent a couple of weeks on this and I'm stumped.