Overview
Rhino plugins are Windows Dynamic Link Libraries, or DLLs. As such, Rhino uses Windows to load your plugin. Rhino attempts to load your plugin, and any dependent DLLs, in the following manner:
- Alternate Search Order - uses
LoadLibraryEx
with theLOAD_WITH_ALTERED_SEARCH_PATH
flag. - Standard Search Order - uses
LoadLibrary
.
NOTE: starting with Windows XP and later, the dynamic-link library (DLL) search order used by the system depends on the setting of the HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode
value. For Windows Server 2003: The default value is 1. Windows XP: The default value is 0.
Alternate Search Order
The LoadLibraryEx
function supports an alternate search order if the call specifies LOAD_WITH_ALTERED_SEARCH_PATH
and the lpFileName
parameter specifies a path. If SafeDllSearchMode
is 1, the alternate search order is as follows:
- The directory specified by
lpFileName
. - The system directory. Use the
GetSystemDirectory
function to get the path of this directory. - The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the
GetWindowsDirectory
function to get the path of this directory. - The current directory.
- The directories that are listed in the
PATH
environment variable.
If SafeDllSearchMode
is 0, the alternate search order is as follows:
- The directory specified by
lpFileName
. - The current directory.
- The system directory. Use the
GetSystemDirectory
function to get the path of this directory. - The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the
GetWindowsDirectory
function to get the path of this directory. - The directories that are listed in the
PATH
environment variable.
Standard Search Order
If SafeDllSearchMode
is 1, the search order is as follows:
- The directory from which the application loaded.
- The system directory. Use the
GetSystemDirectory
function to get the path of this directory. - The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the
GetWindowsDirectory
function to get the path of this directory. - The current directory.
- The directories that are listed in the
PATH
environment variable.
If SafeDllSearchMode
is 0, the search order is as follows:
- The directory from which the application loaded.
- The current directory.
- The system directory. Use the
GetSystemDirectory
function to get the path of this directory. - The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the
GetWindowsDirectory
function to get the path of this directory. - The directories that are listed in the
PATH
environment variable.
Note, Windows 2000 does not support the SafeDllSearchMode
value. T he search order for Windows 2000 is as follows:
- The directory from which the application loaded.
- The current directory.
- The system directory. Use the
GetSystemDirectory
function to get the path of this directory. - The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched.
- The Windows directory. Use the
GetWindowsDirectory
function to get the path of this directory. - The directories that are listed in the
PATH
environment variable.