// hdaudio.h
PFREE_DMA_ENGINE PfreeDmaEngine;
NTSTATUS PfreeDmaEngine(
[in] PVOID _context,
[in] HANDLE Handle
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The FreeDmaEngine routine frees a DMA engine that was previously allocated by a call to AllocateCaptureDmaEngine or AllocateRenderDmaEngine.
The function pointer type for a FreeDmaEngine routine is defined as follows.
_context [in]Specifies the context value from the Context member of the HDAUDIO_BUS_INTERFACE, the HDAUDIO_BUS_INTERFACE_V2 or HDAUDIO_BUS_INTERFACE_BDL structure.
Handle [in]Handle identifying the DMA engine. This handle value was obtained from a previous call to AllocateCaptureDmaEngine or AllocateRenderDmaEngine.
FreeDmaEngine returns STATUS_SUCCESS if the call succeeds in freeing the DMA engine. Otherwise, the routine returns an appropriate error code. The following table shows some of the possible return status codes.
| Return code | Description |
|---|---|
| STATUS_INVALID_HANDLE | Indicates that the handle parameter value is invalid. |
| STATUS_INVALID_DEVICE_REQUEST | Indicates that the stream is not in the reset state or that a buffer is still allocated for the DMA engine. |
This routine frees a DMA engine that was previously reserved by a call to the AllocateCaptureDmaEngine or AllocateRenderDmaEngine routine.
This routine fails and returns error code STATUS_INVALID_DEVICE_REQUEST in either of the following circumstances:
An audio driver calls this routine to close the pin (and destroy the stream).