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 
LoadLibraryExwith theLOAD_WITH_ALTERED_SEARCH_PATHflag. - 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 
GetSystemDirectoryfunction 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 
GetWindowsDirectoryfunction to get the path of this directory. - The current directory.
 - The directories that are listed in the 
PATHenvironment 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 
GetSystemDirectoryfunction 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 
GetWindowsDirectoryfunction to get the path of this directory. - The directories that are listed in the 
PATHenvironment 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 
GetSystemDirectoryfunction 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 
GetWindowsDirectoryfunction to get the path of this directory. - The current directory.
 - The directories that are listed in the 
PATHenvironment 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 
GetSystemDirectoryfunction 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 
GetWindowsDirectoryfunction to get the path of this directory. - The directories that are listed in the 
PATHenvironment 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 
GetSystemDirectoryfunction 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 
GetWindowsDirectoryfunction to get the path of this directory. - The directories that are listed in the 
PATHenvironment variable. 
