The CancelMappedTransfer routine cancels a system DMA transfer that is currently mapped to an adapter.
NTSTATUS CancelMappedTransfer( _In_ PDMA_ADAPTER DmaAdapter, _In_ PVOID DmaTransferContext );
- DmaAdapter [in]
A pointer to a DMA_ADAPTER structure. This structure is the adapter object that is waiting for the pending DMA transfer to complete. The caller obtained this pointer from a previous call to the IoGetDmaAdapter routine, and the caller passed this pointer to the MapTransferEx call that set up the map registers for the DMA transfer.
- DmaTransferContext [in]
A pointer to a DMA transfer context. This parameter value must be the same DMA transfer context that was passed to the AllocateAdapterChannelEx call that requested the adapter channel allocation.
CancelMappedTransfer returns STATUS_SUCCESS if the call is successful. Otherwise, it returns an appropriate error code.
CancelMappedTransfer is not a system routine that can be called directly by name. This routine can be called only by pointer from the address returned in a DMA_OPERATIONS structure. Drivers obtain the address of this routine by calling IoGetDmaAdapter with the Version member of the DeviceDescription parameter set to DEVICE_DESCRIPTION_VERSION3. If IoGetDmaAdapter returns NULL, the routine is not available on your platform.
This routine marks the associated transfer context as canceled, which prevents any further transfers under this context. After a transfer is canceled, its completion routine is called, but the status for the transfer might be set to DmaCancelled.
Regardless of whether a system DMA transfer is canceled or completed, the FlushAdapterBuffers or FlushAdapterBuffersEx routine must always be called to flush any data that remains in the system DMA controller's internal cache at the end of a DMA transfer operation. After the transfer is canceled or completed, the FlushAdapterBuffersXxx call must occur before either the DMA channel is released or the MapTransferEx routine is called to set up the map registers for a new DMA transfer.
|Available starting with Windows 8.|