I have work I need to complete in a DLL as soon as it is loaded. The work involves synchronization and so can't be done inside dllmain. Is there a way to trigger code to execute as soon as dllmain (or all dllmains) is complete?
According to this MSDN post:
During process startup and DLL initialization routines, new threads can be created, but they do not begin execution until DLL initialization is done for the process.
If this holds true, then you should be able to do your work in the Thread in question, which will not start until the DLLMain has completed. Of course this leaves some possible synchronization issues open, If you use a Mutex maybe you can resolve this.
NOTE: I have not tried this, it just looks like in theory it might work.
P.S. If you try it pls leave a comment on whether it worked or not.