Supporting Waveform Devices

Of the types of operations supported by sndblst.sys, waveform I/O operations are the most complex. Waveform operations are complex because they require the use of both interrupts and auto-initialize DMA. Functions within soundlib.lib support both interrupt and DMA operations for waveform devices. To use soundlib.lib for handling waveform devices, you must:

·Within the driver object received by DriverEntry, assign SoundDispatch to be the driver’s main dispatcher for IRP control codes. See “Examining DriverEntry in sndblst.sys.”

·Define a SOUND_DEVICE_INIT structure for waveform input, and another for waveform output. The structures’ DispatchRoutine members must be set to the address of SoundWaveDispatch, which is the waveform dispatch routine within soundlib.lib for DeviceIoControl messages.

·Define a WAVE_INFO structure for each waveform device that can be in operation simultaneously. If your device can only support waveform input or output at one time, then only one WAVE_INFO structure is needed. If input and output can occur simultaneously, two structures must be defined. In sndblst.sys, only one WAVE_INFO structure is defined because input and output cannot occur simultaneously.

·Call SoundCreateDevice once for each SOUND_DEVICE_INIT structure you have defined.