PRWIN9206002: GetModuleFileName Returns Relative File Path

ID Number: Q85330

3.10

WINDOWS

buglist3.10

Summary:

PROBLEM ID: WIN9206002

SYMPTOMS

When the GetModuleFileName function returns a reference to a

dynamic-link library (DLL) file, the reference is relative (not

fully qualified) under the following circumstances:

- One of the directory references in the MS-DOS PATH environment

variable is relative. Assume that the relative directory

reference refers to drive X.

- An application is implicitly linked to a DLL. The DLL is installed

in the current (default) directory of drive X.

- The application is installed in a directory other than the one

in which the DLL is installed.

STATUS

Microsoft has confirmed this to be a problem in Windows version

3.1. We are researching this problem and will post new information

here as it becomes available.

More Information:

The following describes the situations under which this problem

occurs:

- The PATH statement in the AUTOEXEC.BAT file resembles the

following:

PATH=C:\DOS;C:\WINDOWS;D:.;C:\APPS

The relative reference in this path refers to drive D.

- Run an application from the C:\WINDOWS directory that implicitly

links to a DLL that is stored in the current (default) directory

of the D drive.

- If any application calls the GetModuleFileName to retrieve the file

name for the DLL, the function returns a relative reference to the

file (for example, D:.\DLL.DLL).

Additional reference words: 3.10