WdfDmaTransactionGetCurrentDmaTransferLength - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdmatransaction.h

size_t WdfDmaTransactionGetCurrentDmaTransferLength(
  [in] WDFDMATRANSACTION DmaTransaction
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdmatransaction-wdfdmatransactiongetcurrentdmatransferlength)

WdfDmaTransactionGetCurrentDmaTransferLength function

Description

[Applies to KMDF only]

The WdfDmaTransactionGetCurrentDmaTransferLength method returns the size of the current DMA transfer.

Parameters

DmaTransaction [in]

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

Return value

WdfDmaTransactionGetCurrentDmaTransferLength returns the length of the current DMA transfer.

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

Remarks

If a driver calls WdfDmaTransactionGetCurrentDmaTransferLength, it must do so before it calls one of the transfer completion routines, such as WdfDmaTransactionDmaCompleted, to complete the current DMA transfer. Typically, drivers call WdfDmaTransactionGetCurrentDmaTransferLength from within an EvtInterruptDpc event callback function.

Typically, a driver calls WdfDmaTransactionGetCurrentDmaTransferLength for devices that report residual DMA transfer lengths (that is, byte counts of data that was not transferred). By subtracting the residual transfer length from the value that WdfDmaTransactionGetCurrentDmaTransferLength returned, the driver can determine the actual transfer length. The driver then calls WdfDmaTransactionDmaCompletedWithLength to let the framework know the number of bytes that the device actually transferred.

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

Examples

For a code example that uses WdfDmaTransactionGetCurrentDmaTransferLength, see WdfDmaTransactionDmaCompletedWithLength.

See also

EvtInterruptDpc

WdfDmaTransactionCreate

WdfDmaTransactionDmaCompleted

WdfDmaTransactionDmaCompletedWithLength