GET_DMA_ADAPTER callback function (wdm.h)
The GetDmaAdapter routine returns a DMA_ADAPTER structure for the target device.
Syntax
GET_DMA_ADAPTER GetDmaAdapter;
_DMA_ADAPTER * GetDmaAdapter(
[in] PVOID Context,
[in] _DEVICE_DESCRIPTION *DeviceDescriptor,
[out] PULONG NumberOfMapRegisters
)
{...}
Parameters
[in] Context
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.
[in] DeviceDescriptor
A pointer to a DEVICE_DESCRIPTION structure that describes the attributes of the physical device.
[out] NumberOfMapRegisters
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.
Return value
The GetDmaAdapter routine returns a pointer to a DMA_ADAPTER structure when successful. If an adapter structure cannot be allocated, the routine returns NULL.
Remarks
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.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Available starting with Windows 2000. |
Target Platform | Desktop |
Header | wdm.h (include Ntddk.h, Wdm.h) |
IRQL | PASSIVE_LEVEL |