System-wide DLL sometimes relocated?
a DLL has a default image base address.. if that address is
already reserved, it will be mapped somewhere else (assuming
it has a fixup/reloc section).
I need to write a DLL for system-wide message hooking. This
DLL will also have a shared data section.
I was wondering.. what happens if in one process the address
where the DLL prefers to be mapped is already reserved?
Assuming that (only in _that_ process) the OS will load the
DLL in another address.. this may cause a crash if in the
shared data section there's, for example, a pointer to a
How do Win9x/NT OS's solve this problem?
case 1: The DLL won't just be loaded in that process?
case 2: Or will it be loaded, but at the risk of a crash
(i.e. the responsability to avoid it is given in
the hands of the developer, which can check in
DllMain() if he likes or not where the OS mapped
if it's the former that is true, is there anything like a
"public database of known DLLs' imagebases" so that I could
minimize the risk of jumping on the feet of an already taken