Ray Donnelly <[email protected]>
writes:

> From MSDN:
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx
>
> "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."

I'm pretty sure that this applies to loading a dll with the same name as
a previous one from the same process. As you suspect, if that behaviour
were a global rule (affecting all processes) it would be receipt for
DOSing a machine, on the best case.

OTOH I'm 100% sure that placing a dll on the same directory where the
binaries that depend on it are installed protects your application from
the presence of identically named dlls on the system. This is documented
again and again, including the page you link to. When a dll is
*searched*, the system follows the well-known order (directory of the
executable, current directory, etc) but once a dll was *found*, a new
attempt to load the dll with the same name will be subject to the rule
you quoted.


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to