Re: DllMain entrypoint - Is it serialized?
"Bruno van Dooren [MVP VC++]" <bruno_nos_pam_van_dooren@hotmail.com>
wrote in message news:%236Cw6b2wGHA.2120@TK2MSFTNGP03.phx.gbl
if you want to protect your shared memory, I suspect your critical
section objects are named.
There ain't no such thing as a named critical section. You are probably
thinking of a named mutex.
In that case, I hope your dll is not going to be used on Windows 2000,
because initializing named objects on win2000 can cause the loading
of a dll, which can cause a deadlock. This is documented in msdn.
Can you provide a relevant quote from MSDN? The documentation on DllMain
has this to say:
Because Kernel32.dll is guaranteed to be loaded in the process address
space when the entry-point function is called, calling functions in
Kernel32.dll does not result in the DLL being used before its
initialization code has been executed. Therefore, the entry-point
function can call functions in Kernel32.dll that do not load other DLLs.
For example, DllMain can create synchronization objects such as
*critical sections* and *mutexes*, and use TLS.
Emphasis mine.
--
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