On Tue, Nov 27, 2001 at 01:01:47PM -0600, Ross J. Reedstrom wrote:
> However, there's another problem. According to the above, and:
> It is not safe to call FreeLibrary or LoadLibraryEx from DllMain.
> Which points to:
> Warning On attach, the body of your DLL entry-point function
> should perform only simple initialization tasks, such as
> setting up thread local storage (TLS), creating objects, and
> opening files. You must not call LoadLibrary in the entry-point
> function, because you may create dependency loops in the DLL load
> order. This can result in a DLL being used before the system
> has executed its initialization code. Similarly, you must not
> call the FreeLibrary function in the entry-point function on
> detach, because this can result in a DLL being used after the
> system has executed its termination code.
> Any real windows coders know if this is a problem?
Reading into this further, it seems to me that this code is attempting to
implement DLL dependencies. I'd think that the DLL loader is _supposed_
to handle that automatically (based on te docmuentation for LoadLibrary
mentioning that it can cause dependent libraries to also be loaded), but
I know even less about building win32 dlls than I do about coding them.
Are we mis-building somehow?
The warning above also sounds like the only problem is reference loops.
In response to
pgsql-interfaces by date
|Next:||From: Tom Lane||Date: 2001-11-27 19:29:13|
|Subject: Re: Can a windows DLL have more than one process attached? |
|Previous:||From: Ross J. Reedstrom||Date: 2001-11-27 19:01:47|
|Subject: Re: Can a windows DLL have more than one process attached?|