NdisInitializeListHead

VOID
   NdisInitializeListHead(
       IN PLIST_ENTRY ListHead
       );

NdisInitializeListHead initializes a doubly linked, driver-maintained interlocked queue or doubly linked list.

Parameters

ListHead

Points to driver-allocated nonpaged storage for the head of the interlocked queue or list.

Comments

NdisInitializeListHead can be called from a MiniportInitialize function or from a protocol driver’s DriverEntry function if the driver queues requests internally. However, miniport drivers seldom set up internal queues because the NDIS library serializes requests and packets sent to miniports.

Any NDIS driver that maintains an internal queue is responsible for synchronizing driver functions’ accesses to queued entries. The NdisInterlocked..List functions ensure that only one driver function can access queued entries at any given moment, even if the driver is running on a multiprocessor machine, because the queue is protected by a caller-supplied spin lock.

For an interlocked queue, the driver also must provide nonpaged storage for a spin lock. It must initialize the spin lock with NdisAllocateSpinLock before passing a pointer to that spin lock to any of the NdisInterlocked..List functions.

Callers of NdisInitializeListHead usually run at IRQL PASSIVE_LEVEL, because this function is commonly called at initialization.

See Also

DriverEntry of NDIS Protocol Drivers, MiniportInitialize, NdisAllocateSpinLock, NdisInterlockedInsertHeadList, NdisInterlockedInsertTailList, NdisInterlockedRemoveHeadList