I didnt say all dlls should/were designed to be loaded multiple times, but its not imposable to see one that does, lets assume it does some specifc thing to some specific thing, and if u wannna do it to some other thing then just load another copy, sure it could be redesigned to deal with multiple copies, but who knows why its not, maybe it just isnt worth while, maybe its got something to do with what its doing etc. I dont know.
I personally think it is pretty worrying the same dll with a differing path can load twice, then again I cant see why a dll cant auto detect itself already loaded if its not ment to load twice and just hand over to the other one. I certianly know i do it with executables.
PS: I assume it doesnt even need to be just a lfn vs sfn problem ie, i would think this would load twice...
c:\path2file\dll.dll
c:\path2file\..\path2file\dll.dll
----
As i said somewhere above, if someones real concerned make a alias /dll that converts the path and filename to one path and long filename.
[edit]
Scratch that idea, i just thought about it, thats not gonna work as the filename in the $dll() and $dllcall() then wont match.
Maybe Khaled wrote it deliberatly like that so u could load multiple copies.
Actually I wouldnt be supprised if u loaded this
/dll c:\this\is\a\path\dll.dll
then renamed the folder c:\this\is\a to c:\this\is\another that everything is still gonna work ok with $dll(c:\this\is\a\path\dll.dll ... ) since thats the filename used on load, even if the filename is now invalid. (PS this is untested)
And if its the case, when could the filename be validated to being from a already loaded dll, since $dll(c:\this\is\a\path\dll.dll ... ) couldnt be seen as a valid path anymore, but there is a dll in memory that matches it, and another /dll c:\this\is\another\dll.dll would appear to be a seperate dll even if the first is loaded.
^^ the above of course is an extreme example but
Last edited by DaveC; 18/01/05 10:35 AM.