Re: LoadLibrary call hangs ..sometime

Tech-Archive recommends: Fix windows errors by optimizing your registry



These restrictions also apply to static objects initialization, because it's
done in DllMain context.

"Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in message
news:%23ivy8bGoHHA.1244@xxxxxxxxxxxxxxxxxxxxxxx
What does your DLL do in DllMain? There are few things that are safe to do
in DllMain, and doing unsafe things often results in a deadlock. If you
perform some complex initialization in DllMain, consider creating a
separate initialization function and requiring your client to call it
right after loading your DLL.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



.



Relevant Pages

  • DllMain & _beginthreadex (again...)
    ... We are currently initializing our framework inside of DllMain. ... "delayed initialization" of our framework in the Apache module. ... static HANDLE initEvent = NULL; ...
    (microsoft.public.win32.programmer.kernel)
  • Re: DllMain & _beginthreadex (again...)
    ... typical problem of needing to do something useful in DllMain. ... We are currently initializing our framework inside of DllMain. ... "delayed initialization" of our framework in the Apache module. ... static HANDLE initEvent = NULL; ...
    (microsoft.public.win32.programmer.kernel)
  • Re: DllMain PROCESS_DETACH FreeLibrary
    ... The solution of the problem described by Skywing is to make initialization ... For instance, if you LoadLibrary a new DLL from within DllMain, then it ... and in the context of any application for the UI. ... and so the MSDN statement takes on much more relevance. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: DllMain entrypoint - Is it serialized?
    ... reading the following documentation: ... Threads in DllMain hold the loader lock so no ... the processes were in DllMain of my DLL at the same time? ... perform a check in all exported functions to see if initialization still ...
    (microsoft.public.vc.language)
  • Re: DllMain & _beginthreadex (again...)
    ... Any thread created in DllMain won't start running until DllMain exits. ... We are currently initializing our framework inside of DllMain. ... "delayed initialization" of our framework in the Apache module. ... static HANDLE initEvent = NULL; ...
    (microsoft.public.win32.programmer.kernel)