DRIVER_LIST_CONTROL - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

DRIVER_LIST_CONTROL DriverListControl;

VOID DriverListControl(
  [in] _DEVICE_OBJECT *DeviceObject,
  [in] _IRP *Irp,
  [in] PSCATTER_GATHER_LIST ScatterGather,
  [in] PVOID Context
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-wdm-driver_list_control)

Description

The AdapterListControl routine starts a direct memory access (DMA) scatter/gather operation.

Parameters

DeviceObject [in]

Caller-supplied pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.

Irp [in]

Caller-supplied pointer to an IRP structure that describes the I/O operation, if the driver has a StartIo routine. Otherwise, not used.

ScatterGather [in]

Caller-supplied pointer to a SCATTER_GATHER_LIST structure describing scatter/gather regions.

Context [in]

Caller-supplied pointer to driver-defined context information, specified in a previous call to AllocateAdapterChannel.

Remarks

To register an AdapterListControl routine for a specific device object, a driver must call IoGetDmaAdapter to obtain an adapter object, then call GetScatterGatherList to request use of the adapter and to supply the AdapterListControl routine's address. When the adapter is free, the system calls the AdapterListControl routine.

Examples

To define an AdapterListControl callback routine, you must first provide a function declaration that identifies the type of callback routine you're defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define an AdapterListControl callback routine that is named MyAdapterListControl, use the DRIVER_LIST_CONTROL type as shown in this code example:

DRIVER_LIST_CONTROL MyAdapterListControl;

Then, implement your callback routine as follows:

_Use_decl_annotations_
VOID
  MyAdapterListControl(
    struct _DEVICE_OBJECT  *DeviceObject,
    struct _IRP  *Irp,
    PSCATTER_GATHER_LIST  ScatterGather,
    PVOID  Context
    )
  {
      // Function body
  }

The DRIVER_LIST_CONTROL function type is defined in the Wdm.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the DRIVER_LIST_CONTROL function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for WDM Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.

For detailed information about implementing an AdapterListControl routine, see Using Scatter/Gather DMA.