2.5.4 Sound Driver’s Device Objects

Figure 2.22 illustrates the device objects that represent the sound adapter shown previously in Figure 2.11. The sound driver shown in Figure 2.12 creates these device objects by calling an I/O support routine.

Figure 2.22 Sound Device Objects

Like the parallel and serial drivers described in Section 2.5.3, the system-supplied sound driver creates a set of logical device objects: one each for wave-input, wave-output, midi-input, and midi-output operations. If the driver also supports a Win32 Aux and/or mixer driver, it creates a device object to represent it.

An adapter object represents the system DMA controller channel to which the sound card is connected (as shown in Figure 2.11). The NT HAL creates as many adapter objects as the system needs to represent all DMA controller channels or nonSCSI-busmaster adapters in a given machine.

An adapter object is wholly opaque to drivers: the sound driver must use the system’s adapter support routines to accomplish its DMA transfers of (for example) wave data; it cannot access the adapter object by another means. Consequently, this driver has an AdapterControl routine, as shown previously in Figure 2.4.