The AdapterControl routine starts a DMA data-transfer operation.
IO_ALLOCATION_ACTION
AdapterControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID MapRegisterBase,
IN PVOID Context
);
The routine must return one of the enumerated values defined by IO_ALLOCATION_ACTION. Drivers of bus-master devices return either DeallocateObject or DeallocateObjectKeepRegisters; drivers that use system DMA return KeepObject.
A driver's AdapterControl routine executes in an arbitrary thread context at IRQL = DISPATCH_LEVEL.
To register an AdapterControl routine for a specific device object, a driver must call IoGetDmaAdapter to obtain an adapter object, then call AllocateAdapterChannel to request use of the adapter and to supply the AdapterControl routine's address. When the adapter is free, the system calls the AdapterControl routine.
If AdapterControl has been registered by a StartIo routine, then the Irp parameter is guaranteed to point to the IRP currently being processed by the StartIo routine. Otherwise, drivers must set the CurrentIrp member of the device object structure before calling AllocateAdapterChannel.
For detailed information about implementing an AdapterControl routine, see Writing AdapterControl Routines.