@spazzarama knows the most about this, however I'm pretty sure the answer to that is "no". I believe the reason for that is whats called "early loading", and you can never be sure which modules are loaded yet while you are in DllMain(). Which is why Microsoft recommends you do as little as possible in DllMain() and only call APIs out of kernel32.dll. I've learned from experience that if you get too fancy in DllMain() you just end up crashing the application. You may get away with it sometimes, but you may find that you are just getting lucky most of the time and wining the race condition, which means you could have sporadic instability later on. Why is it important for you to do this?