BOOLEAN
IoFlushAdapterBuffers(
IN PADAPTER_OBJECT AdapterObject,
IN PMDL Mdl,
IN PVOID MapRegisterBase,
IN PVOID CurrentVa,
IN ULONG Length,
IN BOOLEAN WriteToDevice
);
IoFlushAdapterBuffers flushes any data remaining in the system DMA controller’s internal cache or in a busmaster adapter’s internal cache at the end of a DMA transfer operation.
IoFlushAdapterBuffers returns TRUE if any data remaining in the DMA controller’s or busmaster adapter’s internal cache has been successfully flushed into system memory or out to the device.
Every driver that performs DMA operations must call IoFlushAdapterBuffers before completing the IRP that requested the DMA transfer to ensure that the transfer is complete.
The initial CurrentVa for the start of a packet-based DMA transfer can be obtained by calling MmGetMdlVirtualAddress. However, the value returned is an index into the Mdl, rather than a valid virtual address. If the driver must split a large transfer request into more than one DMA operation, CurrentVa and Length must be updated for each DMA operation.
Callers of IoFlushAdapterBuffers must be running at IRQL <= DISPATCH_LEVEL.
HalGetAdapter, IoAllocateAdapterChannel, IoMapTransfer, KeFlushIoBuffers, MmGetMdlVirtualAddress