DosGetModName: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:DosGetModName to DosGetModName |
mNo edit summary |
||
Line 1: | Line 1: | ||
This call returns the fully qualified drive, path, file name, and extension associated with a referenced module handle. | |||
This | |||
This is the legacy function. It is recommended to use: "[[DosQueryModuleName]]". | |||
This | |||
==Syntax== | ==Syntax== | ||
DosGetModName (ModuleHandle, BufferLength, Buffer) | |||
DosGetModName | |||
==Parameters== | ==Parameters== | ||
; | ;ModuleHandle (HMODULE) - input : Handle of the dynamic link module being referenced. | ||
;BufferLength (USHORT) - input : Maximum length of the buffer, in bytes, where the name is stored. | |||
; BufferLength (USHORT) - input : Maximum length of the buffer, in bytes, where the name is stored. | ; Buffer (PCHAR) - output : Address of the buffer where the fully qualified drive, path, filename, and extension of the dynamic link module are stored. | ||
; Buffer (PCHAR) - output : Address of the buffer where the fully qualified drive, path, filename, and extension of the dynamic link module are stored. | |||
==Return Code== | ==Return Code== | ||
rc (USHORT) - return | rc (USHORT) - return | ||
Return code descriptions are: | Return code descriptions are: | ||
* 0 NO_ERROR | |||
* 0 | * 6 ERROR_INVALID_HANDLE | ||
* 6 | * 24 ERROR_BAD_LENGTH | ||
* 24 | * 95 ERROR_INTERRUPT | ||
* 95 | |||
==Remarks== | ==Remarks== | ||
Line 59: | Line 50: | ||
* | * | ||
[[Category: | [[Category:Dos]] |
Revision as of 16:04, 18 February 2017
This call returns the fully qualified drive, path, file name, and extension associated with a referenced module handle.
This is the legacy function. It is recommended to use: "DosQueryModuleName".
Syntax
DosGetModName (ModuleHandle, BufferLength, Buffer)
Parameters
- ModuleHandle (HMODULE) - input
- Handle of the dynamic link module being referenced.
- BufferLength (USHORT) - input
- Maximum length of the buffer, in bytes, where the name is stored.
- Buffer (PCHAR) - output
- Address of the buffer where the fully qualified drive, path, filename, and extension of the dynamic link module are stored.
Return Code
rc (USHORT) - return
Return code descriptions are:
- 0 NO_ERROR
- 6 ERROR_INVALID_HANDLE
- 24 ERROR_BAD_LENGTH
- 95 ERROR_INTERRUPT
Remarks
The handle returned by either a DosGetModHandle or a DosLoadModule request can be used with this call. An error is returned if the buffer is not large enough for the module name.
Example Code
C Binding
#define INCL_DOSMODULEMGR USHORT rc = DosGetModName(ModuleHandle, BufferLength, Buffer); HMODULE ModuleHandle; /* Module handle */ USHORT BufferLength; /* Buffer length */ PCHAR Buffer; /* Buffer (returned) */ USHORT rc; /* return code */
MASM Binding
EXTRN DosGetModName:FAR INCL_DOSMODULEMGR EQU 1 PUSH WORD ModuleHandle ;Module handle PUSH WORD BufferLength ;Buffer length PUSH@ OTHER Buffer ;Buffer (returned) CALL DosGetModName Returns WORD