Jump to content

DosGetModName: Difference between revisions

From EDM2
Created page with "image:legacy.png This function has been renamed to "DosQueryModuleName". [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[image:legacy.png]]
This function has been renamed to "[[OS2_API:CPI:DosQueryModuleName|DosQueryModuleName]]". [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg=PT372&dq#v=onepage&q&f=false]
==Description==
This call returns the fully qualified drive, path, file name, and extension associated with a referenced module handle.
This call returns the fully qualified drive, path, file name, and extension associated with a referenced module handle.


==Syntax==
==Syntax==
<PRE>
  DosGetModName (ModuleHandle, BufferLength, Buffer)
  DosGetModName


    (ModuleHandle, BufferLength, Buffer)
</PRE>
==Parameters==
==Parameters==
; ModuleHandle (HMODULE) - input : Handle of the dynamic link module being referenced.  
;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:
 
* 0 NO_ERROR
Return code descriptions are:
* 6 ERROR_INVALID_HANDLE
 
*24 ERROR_BAD_LENGTH
* 0         NO_ERROR  
*95 ERROR_INTERRUPT
* 6         ERROR_INVALID_HANDLE  
* 24       ERROR_BAD_LENGTH  
* 95       ERROR_INTERRUPT


==Remarks==
==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.  
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==
==Bindings==
=== C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSMODULEMGR
#define INCL_DOSMODULEMGR
Line 38: Line 26:
USHORT  rc = DosGetModName(ModuleHandle, BufferLength, Buffer);
USHORT  rc = DosGetModName(ModuleHandle, BufferLength, Buffer);


HMODULE         ModuleHandle;  /* Module handle */
HMODULE ModuleHandle;  /* Module handle */
USHORT           BufferLength;  /* Buffer length */
USHORT BufferLength;  /* Buffer length */
PCHAR           Buffer;        /* Buffer (returned) */
PCHAR   Buffer;        /* Buffer (returned) */


USHORT           rc;            /* return code */
USHORT rc;            /* return code */
</PRE>
</PRE>
===MASM Binding===
 
===MASM===
<PRE>
<PRE>
EXTRN  DosGetModName:FAR
EXTRN  DosGetModName:FAR
Line 56: Line 45:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos16]]

Latest revision as of 04:21, 26 January 2020

This call returns the fully qualified drive, path, file name, and extension associated with a referenced module handle.

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.

Bindings

C

#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

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