// wdm.h
GET_DMA_ADAPTER GetDmaAdapter;
_DMA_ADAPTER * GetDmaAdapter(
[in] PVOID Context,
[in] _DEVICE_DESCRIPTION *DeviceDescriptor,
[out] PULONG NumberOfMapRegisters
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
The GetDmaAdapter routine returns a DMA_ADAPTER structure for the target device.
Context [in]A pointer to interface-specific context information. The caller passes the value that is passed as the Context member of the BUS_INTERFACE_STANDARD structure for the interface.
DeviceDescriptor [in]A pointer to a DEVICE_DESCRIPTION structure that describes the attributes of the physical device.
NumberOfMapRegisters [out]A pointer to, on output, the maximum number of map registers that the driver can allocate for any DMA transfer operation. The caller must allocate a LONG variable to receive this data.
The GetDmaAdapter routine returns a pointer to a DMA_ADAPTER structure when successful. If an adapter structure cannot be allocated, the routine returns NULL.
If the driver is executing at IRQL = PASSIVE_LEVEL, it should obtain a device's DMA adapter object by calling the IoGetDmaAdapter function. IoGetDmaAdapter detects whether the bus driver supports the BUS_INTERFACE_STANDARD interface; if it does, IoGetDmaAdapter calls the routine pointed to by the GetDmaAdapter member of this interface to obtain the adapter object. Otherwise, IoGetDmaAdapter calls an equivalent legacy routine.
However, if a driver must obtain an adapter object while running at IRQL ≥ DISPATCH_LEVEL, it cannot do so with the IoGetDmaAdapter function. In such a case, the driver must query for the BUS_INTERFACE_STANDARD interface while still at IRQL = PASSIVE_LEVEL by issuing an IRP_MN_QUERY_INTERFACE request.