// wdfdmatransaction.h
size_t WdfDmaTransactionGetCurrentDmaTransferLength(
[in] WDFDMATRANSACTION DmaTransaction
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF only]
The WdfDmaTransactionGetCurrentDmaTransferLength method returns the size of the current DMA transfer.
DmaTransaction
[in]A handle to a DMA transaction object that the driver obtained from a previous call to WdfDmaTransactionCreate.
WdfDmaTransactionGetCurrentDmaTransferLength returns the length of the current DMA transfer.
A bug check occurs if the driver supplies an invalid object handle.
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.
For a code example that uses WdfDmaTransactionGetCurrentDmaTransferLength, see WdfDmaTransactionDmaCompletedWithLength.
WdfDmaTransactionDmaCompletedWithLength