Using DMA Channels

After sndblst.sys calls SoundReportResourceUsage to acquire a DMA channel, it calls HalGetAdapter to acquire an adapter object.

Since sndblst.sys uses auto-initialize DMA for transferring data to and from waveform devices, it must acquire an adapter object and allocate a buffer for DMA transfers. The buffer must be noncached and sharable between the driver and the HAL. So, sndblst.sys calls the SoundGetCommonBuffer function in soundlib.lib, which in turn calls HalGetAdapter to acquire the adapter object and HalAllocateCommonBuffer to allocate the buffer. (HalAllocateCommonBuffer is more commonly used for bus-mastering devices.) It also allocates a memory descriptor list.

Since sndblst.sys requires a second DMA channel without an additional DMA buffer, it calls HalGetAdapter directly for the second DMA Channel.