SoundMidiDispatch

NTSTATUS
   SoundMidiDispatch(
       IN OUT PLOCAL_DEVICE_INFO
pLDI,
       IN PIRP
pIrp,
       IN PIO_STACK_LOCATION
IrpStack
       );

The SoundMidiDispatch function is the IRP control code dispatcher for MIDI devices.

Parameters

pLDI

Pointer to a LOCAL_DEVICE_INFO structure.

pIrp

Pointer to an IRP.

IrpStack

Pointer to an I/O stack location.

Return Value

Returns STATUS_SUCCESS if the operation succeeds. Otherwise returns an NTSTATUS error code.

Comments

Kernel-mode MIDI device drivers using soundlib.lib place the address of this function in the DispatchRoutine member of a SOUND_DEVICE_INIT structure. The function is called by soundlib.lib’s main dispatcher, SoundDispatch.

The function processes the following IRP control codes:

IRP_MJ_CLEANUP
IRP_MJ_CLOSE
IRP_MJ_CREATE
IRP_MJ_DEVICE_CONTROL
IRP_MJ_READ

For IRP_MJ_DEVICE_CONTROL, the function processes the following I/O control codes:

IOCTL_MIDI_GET_CAPABILITIES
IOCTL_MIDI_GET_STATE
IOCTL_MIDI_PLAY
IOCTL_MIDI_SET_STATE

See the Kernel-Mode Drivers Design Guide for descriptions of PIRP and PIO_STACK_LOCATION types, along with IRP control codes and I/O control codes.