WdfDmaTransactionDmaCompletedWithLength function

[Applies to KMDF only]

The WdfDmaTransactionDmaCompletedWithLength method notifies the framework that a device's DMA transfer operation is complete and supplies the length of the completed transfer.


BOOLEAN WdfDmaTransactionDmaCompletedWithLength(
  _In_  WDFDMATRANSACTION DmaTransaction,
  _In_  size_t            TransferredLength,
  _Out_ NTSTATUS          *Status



A handle to a DMA transaction object that the driver obtained from a previous call to WdfDmaTransactionCreate.


The number of bytes that the device transferred in the current DMA transfer.


A pointer to a location that receives the status of the DMA transfer. For more information, see the Remarks section for WdfDmaTransactionDmaCompleted.

Return Value

WdfDmaTransactionDmaCompletedWithLength returns FALSE and Status receives STATUS_MORE_PROCESSING_REQUIRED if additional transfers are needed to complete the DMA transaction. The method returns TRUE if no additional transfers are required.

A bug check occurs if the driver supplies an invalid object handle.


When your driver calls the WdfDmaTransactionDmaCompletedWithLength method, the framework ends the current transfer and, if necessary, starts a new one.

The WdfDmaTransactionDmaCompletedWithLength method behaves the same as WdfDmaTransactionDmaCompleted, except that drivers call WdfDmaTransactionDmaCompletedWithLength for devices that report the number of bytes that were transferred. The framework uses the reported byte count to determine the beginning of the next DMA transfer for the specified DMA transaction, if multiple transfers are needed to complete the transaction.

For more information about completing DMA transfers, see Completing a DMA Transfer.

The following code example is from the PLX9x5x sample driver. This example calls WdfDmaTransactionGetCurrentDmaTransferLength to determine the current transfer's original length, and then it calculates the actual transfer length. Next, the example calls WdfDmaTransactionDmaCompletedWithLength to report the actual transfer length to the framework. If the current transfer is the last one for the transaction, the example calls a private routine that completes the I/O request.


Windows Driver kit version
Target platform Universal
Minimum KMDF version 1.0
Minimum UMDF version
Header wdfdmatransaction.h (include Wdf.h)
DDI compliance rules DriverCreate, KmdfIrql, KmdfIrql2

See Also


Send comments about this topic to Microsoft