WdfDmaTransactionGetCurrentDmaTransferLength function (wdfdmatransaction.h)
[Applies to KMDF only]
The WdfDmaTransactionGetCurrentDmaTransferLength method returns the size of the current DMA transfer.
Syntax
size_t WdfDmaTransactionGetCurrentDmaTransferLength(
[in] WDFDMATRANSACTION DmaTransaction
);
Parameters
[in] DmaTransaction
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.
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Header | wdfdmatransaction.h (include Wdf.h) |
Library | Wdf01000.sys (see Framework Library Versioning.) |
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf) |