## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### VSD_DDCMD

DDCMD_STOP (see the ulCmd field of the DDCMDCONTROL structure) operates differently for VSDs than for physical device drivers.

When a PDD receives a DDCMD_STOP, it is assumed that the stop is completed.

When a VSD receives a DDCMD_STOP, the stop is not considered complete when it is returned from the call. Rather it is considered complete when it the VSD is sent a STREAM_STOP_NOW (see ulFlag of the SHD_REPORTINT structure and ulFlag of the MSG_REPORTINT structure.)

Note: VSDs will receive VSD_DDCMD in the ulFunc parameter of the VSDEntry. To process specific VSD_DDCMDs, you must examine the pRequest parameter.

The following code sample shows how this can be written.

    LONG APIENTRY mixerDDCMDEntryPoint(  HVSD   hvsd,

                                         ULONG  ulFunc,

                                         ULONG  ulFlags,

                                         PVOID  pRequest )

    {

      PDDCMDCOMMON  pCommon = (PDDCMDCOMMON) pRequest;

      if (pCommon == NULL)

      {

              return (ERROR_INVALID_BLOCK) ;

      }

      switch (pCommon->ulFunction)

      {

              case DDCMD_SETUP:

                    return DDCmdSetup ((PDDCMDSETUP)pCommon, (PMCI_AMP_INSTANCE)hvsd );

              case DDCMD_READ:

                    return DDCmdRead ((PDDCMDREADWRITE)pCommon, (PMCI_AMP_INSTANCE)hvsd);

              case DDCMD_WRITE:

                    return DDCmdWrite ((PDDCMDREADWRITE)pCommon, (PMCI_AMP_INSTANCE)hvsd);

              case DDCMD_STATUS:

                    return DDCmdStatus ((PDDCMDSTATUS)pCommon, (PMCI_AMP_INSTANCE)hvsd);

              case DDCMD_CONTROL:

                    return DDCmdControl ((PDDCMDCONTROL)pCommon, (PMCI_AMP_INSTANCE)hvsd);

              case DDCMD_REG_STREAM:

                    return DDCmdRegister ((PDDCMDREGISTER)pCommon, (PMCI_AMP_INSTANCE)hvsd);

              case DDCMD_DEREG_STREAM:

                    return DDCmdDeRegister ((PDDCMDDEREGISTER)pCommon, (PMCI_AMP_INSTANCE)hvsd);

              default:

                    return (ERROR_INVALID_FUNCTION);

      }

    }