# C++

Version: Rhino 4.0

## Overview

Rhino plug-ins are Windows Dynamic Link Libraries (DLLs). As such, Rhino uses Windows to load your plug-in. Rhino attempts to load your plug-in, and any dependent DLLs, in the following manner:

2. Standard Search Order - uses LoadLibrary.

Note: Starting with Windows XP, 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.

• 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:

1. The directory specified by lpFileName.
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.
4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
5. The current directory.
6. The directories listed in the PATH environment variable.

If SafeDllSearchMode is 0, the alternate search order is:

1. The directory specified by lpFileName.
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.
5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
6. The directories listed in the PATH environment variable.

## Standard search order

If SafeDllSearchMode is 1, the search order is:

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.
4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
5. The current directory.
6. The directories listed in the PATH environment variable.

If SafeDllSearchMode is 0, the search order is:

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.
5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
6. The directories listed in the PATH environment variable.

Windows 2000 does not support the SafeDllSearchMode value. The search order for Windows 2000 is:

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.
5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
6. The directories listed in the PATH environment variable.