HMODULE *phMod The address into which to store the address's module handle.
ULONG *pObjNum The address into which to store the module's object/segment
number.
ULONG BuffLen The size of the buffer into which the module name will be
stored.
PCHAR pBuff The address of the buffer into which the module name will
be stored.
ULONG *pOffset The address into which the offset into the module segment
will be stored.
PVOID Address The address to be analyzed.
This function may be used to get a program module name, segment number and offset within the segment if you have an absolute address within the calling program. This can be useful when trying to build an exception handler for debugging.
Example:
In this code fragment, pContextRecord is one of the parameters passed to an OS/2 exception handler.
HMODULE hModule ( 0 ) ; ULONG ObjectNumber ( 0 ), Offset ( 0 ) ;
char ModuleName [ CCHMAXPATH + 1 ] = { 0 } ;
DosQueryModFromEIP ( &hModule, &ObjectNumber, sizeof(ModuleName),
ModuleName,
&Offset, (PVOID)pContextRecord->ctx_RegEip ) ;
printf ( "Exception occurred in module '%s', segment %i, offset %08X.\n",
ModuleName, ObjectNumber, Offset ) ;