See the Microsoft documentation here:
http://msdn.microsoft.com/library/default.asp?url="">

Bill's comments are probably related to the "SafeDLLSearchMode". The only thing it really changes is where the "current directory" is in the search order. The Safe mode pushes that down further. Also note that the application directory is the directory where MapInfo Professional was loaded. It is always searched first. by Windows.

The current directory, in my opinion,  is a very flaky thing and we have tried to stay away from depending on it ever in MapInfo Professional. There were some bugs related to this in years past which have long been fixed. For example, at one time you could load an MBX via the dialog but it might not load a second time via the File, Recently used list. The reason? The code had been depending on the current directory being the MBX directory which was true when using a dialog to pick it.

Also, when we did work on Microsoft CE, we noticed there is no "Current directory".

So, stay away from current directory in your code. It will probably come back to bite you.

As for loading MBX, Uffe has it correct with the only addition being that we look at the full path if it is specified. However, few good tools do that. Our code makes sure that we attempt to load the DLL from the MBX path before Windows has a chance to do its search.

Also, you may want to note that XP and above have something called WinSxS! Look for this folder under your "Windows" directory. It does not have to be named, Windows. You will probably see many folders with long names that hold Microsoft DLLs. This is the Windows Side by Side folder also called "Windows fusion" for you googlers. It is meant to replace the Windows and Windows\System32 folders as place for non-system dlls that can be shared and or versioned. In this scheme, you could have multiple versions of A.DLL on the system which should improve backward compatibility.  For those familiar with the GAC(Global Assembly Cache) in .NET, this is sort of a GAC for native Win32 code DLLs. It does not, however, need to be a Microsoft DLL.

We are not sure how this will impact MapInfo Professional. However, if you had an MBX that used a DLL that provided a simple interface that used some other DLLs, those latter DLLs might want to go here.  Another idea would be our raster handlers which is some cases wrap image libraries by other vendors (Lead tools, Mr.Sid, ECW). Those vendors often install their DLLs in the system folder where the last one (or latest one ) wins which is not always a good idea. If those vendors used this technology, it would just work without any changes.

Eric Blasenheim
Principal Software Architect
MapInfo Corporation


 




Mail List:mapinfo-l-bounces
From: "Uffe Kousgaard" <[EMAIL PROTECTED]> on 06/15/2006 09:10 AM ZE2
To: "Mapinfo-L" <[email protected]>
cc: "mapinfo-l" <[email protected]>
Subject: LinkRe: [MI-L] Dynamic dll locations


From: "Bill Thoen" <[EMAIL PROTECTED]>

> I've heard that Microsoft has changed that rule for security reasons. I
> think it no longer searches the local direcotry *first*. It will search
> for it there eventually, but only as the last resort. I think its first
> choice is \Windows\system32\ but I don't know its full search path.

I did a small test on XP Pro with all service packs. This is the order:

mbx folder
mapinfow.exe folder
windows/system32
windows/system
windows
PATH environment

I think this is how it's always been. There is also the "current dir", but I
was too lazy to test that one.

Regards
Uffe


_______________________________________________
MapInfo-L mailing list
[email protected]

http://www.directionsmag.com/mailman/listinfo/mapinfo-l

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to