Article ID: 155793
Article Last Modified on 7/11/2005
APPLIES TO
- Microsoft Platform Software Development Kit-January 2000 Edition, when used with:
- Microsoft Windows NT 3.51 Service Pack 5
- Microsoft Windows 2000 Standard Edition
- Microsoft Windows XP Professional
This article was previously published under Q155793
SYMPTOMS
The location of a dynamic-link library (DLL) is specified in the Path
environment variable. In the Path environment variable, if a network path
is defined before the path that contains the DLL, the following problem can
occur.
For example, if you use the following path command, where "S:" is a network
drive:
Path=S:\;D:\Mydll or Path=\\franki\public;d:\Mydll
The process which loads the DLL does not have security access to the
network drive specified in the Path environment variable. When the
operating system searches for the DLL and comes across the inaccessible
network drive, the search ends instead of moving on to the next specified
path in the Path environment variable.
If the application is implicitly loading the DLL, you get the following
error message:
The application failed to initialize properly (0xc0000022). Click on
OK to terminate the application.
If the DLL is being explicitly loaded via the LoadLibrary or LoadLibraryEx
API call, the call fails with an error code 5 or Access denied.
CAUSE
When the operating system reaches the path environment variable, it
concatenates the DLL name to the path. For example, if the path is
"D:\Mydll" and the name of the DLL is Mydll.dll, the operating system tries
to open up the file "D:\Mydll\Mydll.dll." The CreateFile API call which is
used to open the file cannot distinguish between an Access denied error
caused by a process which cannot access a file versus a process which
cannot access the network drive that contains the file. Because this
distinction cannot be made, the operating system assumes that the file
exists but cannot be accessed by the process. This error causes the
operating system to discontinue the search for the DLL and assume that the
DLL cannot be accessed even though the DLL is located in one of paths
defined after the network drive.
Additional query words: kbdss
Keywords: kbapi kbdll kbenv kbfileio kbkernbase kbprb KB155793