The process of loading a DLL for the first time, implicitly or explicitly,
invokes Windows 95 to search for the specified DLL in a predefined order
until the DLL is found or all search efforts are exhausted. In Windows 95,
the string values associated with the Known16DLLs registry key have the
ability to reset the normal search order used to locate and load a 16-bit
DLL to a new predefined order. Thus, a string value that identifies a 16-
bit DLL and is also associated with the Known16DLLs registry key will force
Windows 95 to begin its search for the DLL in the System directory - not
the current directory.
In Windows 95, the predefined order that is used to locate and load a
16-bit DLL is specified as follows:
- The current directory.
- The Windows directory (the directory containing Win.com).
- The Windows system directory (the directory containing such system files
- The directory containing the executable file for the current task.
- The directories listed in the PATH environment variable.
NOTE: If a 16-bit DLL is already loaded by some running application,
Windows 95 does not search for the DLL to load, even if the full path name
is supplied to LoadLibrary. Instead Windows 95 will resolve the imports to
link to the DLL already in memory.
This search order is reset if a 16-bit DLL being loaded has a string value
with the same name as the 16-bit DLL specified in the Known16DLLs registry
key. The Known16DLLs registry key is located at:
The data associated with the DLL string value can take any form. An example
of such a string value is:
"COMMCTRL.DLL" "SYSTEM COMMCTRL.DLL"
When a string value for a 16-bit DLL exists, the new search order is as
- The Windows system directory.
- The Windows directory.
- The current directory.
- The directory from which the application loaded.
- The directories that are listed in the PATH environment variable.
There are three ways that this DLL string value can be added to the
- An end user can use Regedit.exe to add the 16-bit DLL string value to
the Known16DLLs registry key.
- The 16-bit DLL string value can be added programmatically to the
Known16DLLs registry key using registry APIs.
- Windows 95 can automatically add the 16-bit DLL string value to the
Known16DLLs registry key.
The first two ways to add the 16-bit DLL string value are basic and require
no further explanation; however, the third method is more complex. Each
time a 16-bit DLL is loaded from the Windows System directory, Windows 95
checks the Known16DLLs registry key for a string value that has that same
name. If the string value does not exist, Windows 95 creates it in the
Known16DLLs registry key. Thus, any application that uses a DLL that has
the same name as a DLL listed in the Known16DLLs registry key will always
use the reset search order to locate the DLL. As long as the DLL exists in
the Windows System directory and can be loaded by another application,
deletion of the string value will not be effective in returning the search
order to its original predefined state.
Article ID: 141969 - Last Review: January 16, 2015 - Revision: 4.2
- Microsoft Win32 Application Programming Interface, when used with:
- Microsoft Windows 95
- Microsoft Windows 98 Standard Edition
- Microsoft Windows Millennium Edition
|kbnosurvey kbarchive kbdll kbenv kbhowto kbkernbase KB141969|