Jump to content

mmioQueryIOProcModuleHandle

From EDM2

The mmioQueryIOProcModuleHandle function provides the module handle of an I/O procedure's DLL. This handle must be used to retrieve resources from the DLL.

Syntax

#define INCL_MMIOOS2
#include <os2.h>

ULONG mmioQueryIOProcModuleHandle(PMMIOPROC pIOProc, PHMODULE phmodIOProc);

Parameters

pIOProc (PMMIOPROC) - input
Indicates a specific entry point of an I/O procedure for which the DLL module handle is to be retrieved. That is, the address of the DLL's entry point, directed to a PMMIOPROC.
phmodIOProc (PHMODULE) - output
Pointer to a PHMODULE. Returns the module handle to the DLL.

Return Value

rc (ULONG) - returns
Return codes indicating success or type of failure:
  • MMIO_SUCCESS: If the function succeeds, 0 is returned.
  • MMIO_ERROR: The function failed for a reason different from any of the following returns in this list.
  • MMIOERR_INVALID_PARAMETER: An invalid parameter was passed.
  • MMIOERR_INTERNAL_SYSTEM: An internal system error occurred.

Remarks

The **mmioQueryIOProcModuleHandle** function can only provide the handle to the DLL if it was loaded by MMIO from the `MMPMMMIO.INI` file.

Example Code

The following code illustrates how to obtain the module handle of an IOProc's DLL.

   HMODULE hmodIOProc;
   ULONG rc;
    ...

   rc = mmioQueryIOProcModuleHandle((PMMIOPROC)&MyIOProc, &hmodIOProc);
   if (rc)
      /* error */
   else
   {
      /* hmodIOProc now contains the module handle */
   }
    ...

The following is a procedure prototype for a standard I/O procedure call.

LONG APIENTRY MMIOPROC (PVOID pmmioinfo, USHORT usMsg,
                        LONG lParam1, LONG lParam2);


Related Functions