7.3.1 Storage Requirements for Driver-Managed Queues

Any NT driver that uses either an interlocked or supplemental device queue must provide storage for the necessary NT objects and resources.

If it uses either kind of queue, an NT driver must provide storage for the following:

·For a doubly-linked interlocked queue, storage both for an executive spin lock, required as a parameter to the ExInterlocked..List routines, and for the queue header of type LIST_ENTRY

For more information about using spin locks, see Chapter 16.

·For a device queue, storage for a Kernel-defined device queue object

While each device queue object has an associated executive spin lock and a queue header, storage for these resources is allocated automatically when the driver provides storage for its device queue object.

NT drivers usually provide this storage in the device extensions of their device objects, but they can call ExAllocatePool with the PoolType parameter set to NonPagedPool to allocate storage or can provide storage in a controller extension if they use controller objects.

For more information about allocating pool memory, see Chapter 16. For more information about controller objects, see Chapter 3.