Device driver stream handlers receive commands from PDDs to report events and interrupts. These stream handler device (SHD) helper commands are provided through the SHDEntryPoint. This entry point is specifically used for the PDD to call back to the stream handler. For example, the PDD can send an SHD_REPORT_INT command to the stream handler to report status, indicate that a buffer is full, or specify that an additional buffer is required.

The following example illustrates the code implementation of the SHDEntryPoint.

ULONG   (*ShdFuncs[])(PVOID pCommon) = {  /* SHD message jump table */
                        SHDReportInt,                   /* 0 */
                        SHDReportEvent                  /* 1 */
                        };

USHORT  MaxShdFuncs = sizeof(ShdFuncs)/sizeof(USHORT);
/*************************************************************************/

RC SHDEntryPoint(pCommon)
PSHD_COMMON     pCommon;
{
      if (pCommon->ulFunction > (ULONG)MaxShdFuncs)

             return(ERROR_INVALID_FUNCTION); /* Check for valid function */

      return(ShdFuncs[pCommon->ulFunction](pCommon));
}                                            /* Call SHC message         */

/*************************************************************************/


[Back] [Next]