PFREE_DMA_ENGINE callback function

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.

Syntax

PFREE_DMA_ENGINE PfreeDmaEngine;

NTSTATUS PfreeDmaEngine(
  PVOID _context,
  HANDLE Handle
)
{...}

Parameters

_context

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

Handle identifying the DMA engine. This handle value was obtained from a previous call to AllocateCaptureDmaEngine or AllocateRenderDmaEngine.

Return value

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.

Remarks

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).

Requirements

   
Target Platform Desktop
Header hdaudio.h (include Hdaudio.h)
IRQL <=DISPATCH_LEVEL

See also

AllocateCaptureDmaEngine

AllocateRenderDmaEngine

FreeContiguousDmaBuffer

FreeDmaBuffer

HDAUDIO_BUS_INTERFACE

HDAUDIO_BUS_INTERFACE_BDL

HDAUDIO_BUS_INTERFACE_V2