Adapter Driver Construction
Driver support for a particular audio adapter card takes the form of an adapter driver. An adapter driver consists of the following:
General adapter code that performs driver startup and initialization, and that implements any operations that are common to all audio functions on the adapter card.
A set of miniport drivers that manage specific audio functions on the adapter card.
The hardware vendor supplies both the general adapter code and the code for any miniport drivers that are not provided by the system.
For an example of the general adapter code, see the implementation of the CAdapterCommon interface in the Sysvad sample driver, which is discussed in Sample Audio Drivers.
By using a layered approach, the vendor can write an adapter driver that operates on one of several levels, depending on the adapter's hardware functionality. When determining the level of support that a given hardware function requires, the vendor should first determine whether a system-supplied miniport driver already exists that supports the function (see the PcNewMiniport function's list of system-supplied miniport drivers). If not, the vendor must implement a proprietary miniport driver but might still be able to use one of the system-supplied port drivers (see the PcNewPort function's list of system-supplied port drivers).
To implement WDM support for a device, follow these steps:
If a system-supplied miniport driver already supports the hardware function, use the existing miniport driver to manage the function.
If the hardware function is not compatible with a system-supplied miniport driver, then determine whether the function is compatible with at least one of the system-supplied port drivers. If a system-supplied port driver supports the hardware function, write the portion of the miniport driver that manages the function. That miniport driver should comply with the specification for the miniport interface that the owning port driver expects.
If no system-supplied port driver supports the hardware function, write a minidriver to support the function. The minidriver should comply with the interface specification for the streaming class driver.
This section discusses the following topics: