// wdm.h
typedef struct _DMA_OPERATIONS {
ULONG Size;
PPUT_DMA_ADAPTER PutDmaAdapter;
PALLOCATE_COMMON_BUFFER AllocateCommonBuffer;
PFREE_COMMON_BUFFER FreeCommonBuffer;
PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel;
PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers;
PFREE_ADAPTER_CHANNEL FreeAdapterChannel;
PFREE_MAP_REGISTERS FreeMapRegisters;
PMAP_TRANSFER MapTransfer;
PGET_DMA_ALIGNMENT GetDmaAlignment;
PREAD_DMA_COUNTER ReadDmaCounter;
PGET_SCATTER_GATHER_LIST GetScatterGatherList;
PPUT_SCATTER_GATHER_LIST PutScatterGatherList;
PCALCULATE_SCATTER_GATHER_LIST_SIZE CalculateScatterGatherList;
PBUILD_SCATTER_GATHER_LIST BuildScatterGatherList;
PBUILD_MDL_FROM_SCATTER_GATHER_LIST BuildMdlFromScatterGatherList;
PGET_DMA_ADAPTER_INFO GetDmaAdapterInfo;
PGET_DMA_TRANSFER_INFO GetDmaTransferInfo;
PINITIALIZE_DMA_TRANSFER_CONTEXT InitializeDmaTransferContext;
PALLOCATE_COMMON_BUFFER_EX AllocateCommonBufferEx;
PALLOCATE_ADAPTER_CHANNEL_EX AllocateAdapterChannelEx;
PCONFIGURE_ADAPTER_CHANNEL ConfigureAdapterChannel;
PCANCEL_ADAPTER_CHANNEL CancelAdapterChannel;
PMAP_TRANSFER_EX MapTransferEx;
PGET_SCATTER_GATHER_LIST_EX GetScatterGatherListEx;
PBUILD_SCATTER_GATHER_LIST_EX BuildScatterGatherListEx;
PFLUSH_ADAPTER_BUFFERS_EX FlushAdapterBuffersEx;
PFREE_ADAPTER_OBJECT FreeAdapterObject;
PCANCEL_MAPPED_TRANSFER CancelMappedTransfer;
PALLOCATE_DOMAIN_COMMON_BUFFER AllocateDomainCommonBuffer;
PFLUSH_DMA_BUFFER FlushDmaBuffer;
PJOIN_DMA_DOMAIN JoinDmaDomain;
PLEAVE_DMA_DOMAIN LeaveDmaDomain;
PGET_DMA_DOMAIN GetDmaDomain;
PALLOCATE_COMMON_BUFFER_WITH_BOUNDS AllocateCommonBufferWithBounds;
PALLOCATE_COMMON_BUFFER_VECTOR AllocateCommonBufferVector;
PGET_COMMON_BUFFER_FROM_VECTOR_BY_INDEX GetCommonBufferFromVectorByIndex;
PFREE_COMMON_BUFFER_FROM_VECTOR FreeCommonBufferFromVector;
PFREE_COMMON_BUFFER_VECTOR FreeCommonBufferVector;
PCREATE_COMMON_BUFFER_FROM_MDL CreateCommonBufferFromMdl;
} *PDMA_OPERATIONS, DMA_OPERATIONS;
View the official Windows Driver Kit DDI referenceNo description available.
The DMA_OPERATIONS structure provides a table of pointers to functions that control the operation of a DMA controller.
SizeThe size, in bytes, of this DMA_OPERATIONS structure.
PutDmaAdapterA pointer to a system-defined routine to free a DMA_ADAPTER structure. For more information, see PutDmaAdapter.
AllocateCommonBufferA pointer to a system-defined routine to allocate a physically contiguous DMA buffer. For more information, see AllocateCommonBuffer.
FreeCommonBufferA pointer to a system-defined routine to free a physically contiguous DMA buffer previously allocated by AllocateCommonBuffer. For more information, see FreeCommonBuffer.
AllocateAdapterChannelA pointer to a system-defined routine to allocate a channel for DMA operations. For more information, see AllocateAdapterChannel.
FlushAdapterBuffersA pointer to a system-defined routine to flush data from the system or bus-master adapter's internal cache after a DMA operation. For more information, see FlushAdapterBuffers.
FreeAdapterChannelA pointer to a system-defined routine to free a channel previously allocated for DMA operations by AllocateAdapterChannel. For more information, see FreeAdapterChannel.
FreeMapRegistersA pointer to a system-defined routine to free map registers allocated for DMA operations. For more information, see FreeMapRegisters.
MapTransferA pointer to a system-defined routine to begin a DMA operation. For more information, see MapTransfer.
GetDmaAlignmentA pointer to a system-defined routine to obtain the DMA alignment requirements of the controller. For more information, see GetDmaAlignment.
ReadDmaCounterA pointer to a system-defined routine to obtain the current transfer count for a DMA operation. For more information, see ReadDmaCounter.
GetScatterGatherListA pointer to a system-defined routine that allocates map registers and creates a scatter/gather list for DMA. For more information, see GetScatterGatherList.
PutScatterGatherListA pointer to a system-defined routine that frees map registers and a scatter/gather list after a DMA operation is complete. For more information, see PutScatterGatherList.
CalculateScatterGatherListA pointer to a system-defined routine that determines the buffer size needed to hold the scatter/gather list that describes an I/O data buffer. This member is available only in versions 2 and later of DMA_OPERATIONS. For more information, see CalculateScatterGatherList.
BuildScatterGatherListA pointer to a system-defined routine that allocates map registers and creates a scatter/gather list for DMA in a driver-supplied buffer. This member is available only in versions 2 and later of DMA_OPERATIONS. For more information, see BuildScatterGatherList.
BuildMdlFromScatterGatherListA pointer to a system-defined routine that builds an MDL corresponding to a scatter/gather list. This member is available only in versions 2 and later of DMA_OPERATIONS. For more information, see BuildMdlFromScatterGatherList.
GetDmaAdapterInfoA pointer to a system-defined routine that describes the capabilities of a bus-master DMA device or a system DMA controller. GetDmaAdapterInfo is available only in version 3 of DMA_OPERATIONS. For more information, see GetDmaAdapterInfo.
GetDmaTransferInfoA pointer to a system-defined routine that describes the allocation requirements for a scatter/gather list. This routine replaces CalculateScatterGatherList. GetDmaTransferInfo is available only in version 3 of DMA_OPERATIONS. For more information, see GetDmaTransferInfo.
InitializeDmaTransferContextA pointer to a system-defined routine that initializes an opaque DMA transfer context. The operating system stores the internal status of a DMA transfer in this context. InitializeDmaTransferContext is available only in version 3 of DMA_OPERATIONS. For more information, see InitializeDmaTransferContext.
AllocateCommonBufferExA pointer to a system-defined routine that allocates memory for a common buffer and maps this memory so that it can accessed both by the processor and by a DMA device. AllocateCommonBufferEx is available only in version 3 of DMA_OPERATIONS. For more information, see AllocateCommonBufferEx.
AllocateAdapterChannelExA pointer to a system-defined routine that allocates the resources required for a DMA transfer and then calls the driver-supplied AdapterControl routine to initiate the DMA transfer. AllocateAdapterChannelEx is available only in version 3 of DMA_OPERATIONS. For more information, see AllocateAdapterChannelEx.
ConfigureAdapterChannelA pointer to a system-defined routine enables a custom function that is implemented by the DMA controller. ConfigureAdapterChannel is available only in version 3 of DMA_OPERATIONS. For more information, see ConfigureAdapterChannel.
CancelAdapterChannelA pointer to a system-defined routine that tries to cancel a pending request to allocate a DMA channel. CancelAdapterChannel is available only in version 3 of DMA_OPERATIONS. For more information, see CancelAdapterChannel.
MapTransferExA pointer to a system-defined routine that sets up map registers to map the physical addresses in a scatter/gather list to the logical addresses that are required to do a DMA transfer. MapTransferEx is available only in version 3 of DMA_OPERATIONS. For more information, see MapTransferEx.
GetScatterGatherListExA pointer to a system-defined routine that allocates resources required for a DMA transfer, builds a scatter/gather list, and then calls the driver-supplied AdapterListControl routine to initiate the DMA transfer. GetScatterGatherListEx is available only in version 3 of DMA_OPERATIONS. For more information, see GetScatterGatherListEx. This routine is a wrapper of AllocateAdapterChannelEx and MapTransferEx.
BuildScatterGatherListExA pointer to a system-defined routine that builds a scatter/gather list in a caller-allocated buffer, and then calls the driver-supplied AdapterListControl routine to initiate the DMA transfer. BuildScatterGatherListEx is available only in version 3 of DMA_OPERATIONS. For more information, see BuildScatterGatherListEx.
FlushAdapterBuffersExA pointer to a system-defined routine that flushes any data that remains in the system DMA controller's internal cache or in a bus-master adapter's internal cache at the end of a DMA transfer. For a device that uses a system DMA controller, this routine cancels the current DMA transfer on the controller if the transfer is not complete. FlushAdapterBuffersEx is available only in version 3 of DMA_OPERATIONS. For more information, see FlushAdapterBuffersEx.
FreeAdapterObjectA pointer to a system-defined routine that releases the specified adapter object after a driver has completed all DMA operations. FreeAdapterObject is available only in version 3 of DMA_OPERATIONS. For more information, see FreeAdapterObject.
CancelMappedTransferA pointer to a system-defined routine that cancels a mapped transfer. CancelMappedTransfer is available only in version 3 of DMA_OPERATIONS. For more information, see CancelMappedTransfer.
AllocateDomainCommonBufferA pointer to a PALLOCATE_DOMAIN_COMMON_BUFFER callback routine to allocate a domain common buffer. This option is available in Windows 10 and later versions.
FlushDmaBufferA pointer to a PFLUSH_DMA_BUFFER callback function that flushes any data remaining in the cache. This option is available in Windows 10 and later versions.
JoinDmaDomainA pointer to a PJOIN_DMA_DOMAIN callback function that joins the specified DMA domain. This option is available in Windows 10 and later versions.
LeaveDmaDomainA pointer to a PLEAVE_DMA_DOMAIN callback function that leaves the specified DMA domain. This option is available in Windows 10 and later versions.
GetDmaDomainA pointer to the PGET_DMA_DOMAIN callback function that gets a handle to the DMA domain. This option is available in Windows 10 and later versions.
AllocateCommonBufferWithBoundsA pointer to a PALLOCATE_COMMON_BUFFER_WITH_BOUNDS callback function that allocates the memory for a common buffer and maps it so that it can be accessed by a master device and the CPU. The common buffer can be bound by an optional minimum and maximum logical address. This option is available starting in Windows 10, version 1803.
AllocateCommonBufferVectorA pointer to a PALLOCATE_COMMON_BUFFER_VECTOR callback function that allocates multiple common buffers as a vector, allowing for efficient batch allocation of DMA-accessible memory regions.
GetCommonBufferFromVectorByIndexA pointer to a PGET_COMMON_BUFFER_FROM_VECTOR_BY_INDEX callback function that retrieves the virtual and logical addresses of a specific common buffer from a previously allocated vector by its index.
FreeCommonBufferFromVectorA pointer to a PFREE_COMMON_BUFFER_FROM_VECTOR callback function that frees a specific common buffer from a vector by its index, allowing for individual buffer deallocation within the vector.
FreeCommonBufferVectorA pointer to a PFREE_COMMON_BUFFER_VECTOR callback function that frees an entire common buffer vector and all its associated buffers that were previously allocated by AllocateCommonBufferVector.
CreateCommonBufferFromMdlA pointer to a PCREATE_COMMON_BUFFER_FROM_MDL callback function that will create a DMA common buffer from an MDL and maps the backing memory so that it can be accessed by a bus-mastering device and the CPU. This optional callback is available starting in Windows Server 2022.
All members of this structure, with the exception of Size, are pointers to functions that drivers use to perform DMA operations for their devices. Drivers obtain these pointers by calling the IoGetDmaAdapter routine. The version of the DMA_OPERATIONS structure that this routine returns depends on the Version member of the DEVICE_DESCRIPTION structure that is passed to IoGetDmaAdapter as an input parameter. If Version is DEVICE_DESCRIPTION_VERSION or DEVICE_DESCRIPTION_VERSION1, version 1 of this structure is returned. If Version is DEVICE_DESCRIPTION_VERSION2, version 2 of this structure is returned. Version 2 of DMA_OPERATIONS is available starting with Windows XP. If Version is DEVICE_DESCRIPTION_VERSION3, version 3 of this structure is returned. Version 3 of DMA_OPERATIONS is available starting with Windows 8.