realbasic-nug
[Top] [All Lists]

Re: Win32 DLL install

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Win32 DLL install
From: Brady Duga <duga at ljug dot com>
Date: Mon, 31 Jan 2005 07:07:01 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <29d2148c0c135981a5ba5908f03e600e at chartermi dot net> <41FE4357 dot 7070000 at realsoftware dot com>

On Jan 31, 2005, at 6:40 AM, Aaron Ballman wrote:

Shared libraries need to be placed in the proper location for each platform. For Windows, that's 1) next to the application as it's running, 2) in the user's System directory (usually System32), or 3) in the search path for DLLs, which I don't recall off the top of my head.

Oddly enough, Mars just pointed me in the right direction for this. Here is the search path for Windows:


If no file name extension is specified in the lpFileName parameter, the default library extension .dll is appended. However, the file name string can include a trailing point character (.) to indicate that the module name has no extension. When no path is specified, the function searches for loaded modules whose base name matches the base name of the module to be loaded. If the name matches, the load succeeds. Otherwise, the function searches for the file. The search order used depends on the setting of the HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode value. Windows 2000/NT and Windows Me/98/95:  The SafeDllSearchMode value does not exist.

If SafeDllSearchMode is 1 (the default), the search order is as follows:
        1.  The directory from which the application loaded.

2. The system directory. Use the GetSystemDirectory function to get the path of this directory.

3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
 Windows Me/98/95:  This directory does not exist.

4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.

        5. The current directory.

        6. The directories that are listed in the PATH environment variable.

If SafeDllSearchMode is 0, the search order is as follows:
        1. The directory from which the application loaded.

        2. The current directory.

3. The system directory. Use the GetSystemDirectory function to get the path of this directory.

4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
 Windows Me/98/95:  This directory does not exist.

5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.

        6. The directories that are listed in the PATH environment variable.

Windows XP:  The default value of HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 0 (the current directory is searched before the system and Windows directories).

--Brady
The La Jolla Underground_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>