I have an ActiveX control (foo.dll), when I embedded the same in the IE and start the page. I could see that the process explorer shows two instances of the foo.dll loaded from the same location.
This causes the DLL_PROCESS_ATTACH to be called twice and the global data structures gets initialized twice.
Is there a way to workaround this ? how does the windows loader works ?
Thanks, Velu
DLL_PROCESS_ATTACH
should only be called once per instance of the DLL . . . are the DLL's loaded at the same base address, i.e., is the HINSTANCE in DllMain the same? Are they loaded from the exact same path? Different paths result in diffent loaded modules. Is it being unloaded in between the two loads? Are you sure you're seeing DLL_PROCESS_ATTACH
and not DLL_THREAD_ATTACH
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With