I'm working on an old DLL interface library for an external piece of hardware.
This library uses shared data segments (#pragma data_seg(...)) to share the structures for the hardware status among processes.
I thought that, based on this, the DLL is loaded by Windows only once, but I've found that the processes loading the DLL must load it from the same path for the whole comunication between them to work correctly. Even the documentation of the library states this.
In the linked page is explicitly reported that:
If a DLL with the same module name is already loaded in memory, the system checks only for redirection and a manifest before resolving to the loaded DLL, no matter which directory it is in. The system does not search for the DLL.
so I'm a bit confused... Does the location of the DLL impact on the shared data segments (from the point of view of different processes) or not?
Evidence shows that it is so, but were I'm misunderstanding the documentation?