Jump to content

DDCMDEntryPoint

From EDM2

The DDCMDEntryPoint function provides the interface through which device driver stream handlers communicate with the hardware Physical Device Driver (PDD).

Syntax

#include <os2.h>

ULONG DDCMDEntryPoint(PDDCMDCOMMON pCommon);

Parameters

pCommon (PDDCMDCOMMON) - input
A pointer to a DDCMD message-specific input parameter block. This structure contains the function code and specific data required for the command being issued. See DDCMDCOMMON for the base structure.

Return Value

rc (ULONG) - returns
Return codes indicating success or the type of failure:
  • NO_ERROR: Successful.
  • ERROR_INVALID_FUNCTION: The function requested is not supported by the PDD.
  • FAILURE: A DDCMD message-specific error return code was encountered.

Remarks

Stream handlers use the DDCMDEntryPoint to request that a PDD perform hardware-level operations, such as starting, stopping, or resuming device activity.

This interface utilizes the **Inter-Device Communication (IDC)** mechanism. To use this entry point, the stream handler must first perform the following steps:

  1. Call the ATTACHDD Device Helper (DevHelp) function.
  2. Obtain the IDC entry point address for the target Physical Device Driver.
  3. Use that address to issue Device Driver Command (DDCMD) messages.

Example Code

The following snippet shows the general pattern of calling a PDD entry point once the address has been obtained via IDC.

  #include "os2.h"
  #include "os2me.h"

  ULONG         rc;
  PDDCMDCOMMON  pDDCMD;
  PFN           pfnDDCMDEntryPoint; /* Address obtained via ATTACHDD */

  /* ... Assume pfnDDCMDEntryPoint is initialized and pDDCMD is populated ... */

  /* Invoke the PDD command entry point */
  rc = pfnDDCMDEntryPoint(pDDCMD);

  if (rc != NO_ERROR) {
     /* Handle PDD-specific error */
  }

Related Functions