On Sat, 10 Jun 2006 21:37:01 -0500, Carl Fongheiser wrote:
Bad, bad idea. In Windows programming, you *never* call LoadLibrary from DllMain. Inside of DllMain, you can't call anything which uses the loader lock, because the loader lock is already taken out. As best as I read the Wine code, it has the same limitation.
Loader lock is a recursive critical section so it's OK to do that from the same thread and actually, the Wine loader code is written to allow that to work.
That said it's quite dangerous to do much of anything inside a DllMain because so much stuff in Win32 relies on multiple threads or inter-thread messaging behind your back.
thanks -mike