dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosGetModName (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSMODULEMGR
 
USHORT DosGetModName(hmod, cbBuf, pchBuf)
HMODULE hmod;    /* module handle                           */
USHORT cbBuf;    /* number of bytes in buffer               */
PCHAR pchBuf;    /* pointer to buffer receiving module name */
 
The DosGetModName function retrieves the drive, path, and filename of the
specified module.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hmod       Identifies the dynamic-link module. This handle must have been
           created previously by using the DosLoadModule or DosGetModName
           function.
 
cbBuf      Specifies the maximum length (in bytes) of the buffer that
           receives the information about the module.
 
pchBuf     Points to the buffer that receives the module's drive, path, and
           filename.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_BAD_LENGTH
     ERROR_INTERRUPT
     ERROR_INVALID_HANDLE
 
Comments
 
The DosGetModName function returns an error if there is not enough room in
the buffer for the drive, path, and filename.
 
When a function within a dynamic-link library is called, or when the
dynamic-link library initializes itself, the di register contains the module
handle for the current process.
 
See Also
 
DosFreeModule, DosGetModHandle, DosLoadModule, DosMonOpen