Share via


NdisInitializeListHead (NDIS 5.1) function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NdisInitializeListHead initializes a doubly linked, driver-maintained queue.

Syntax

VOID NdisInitializeListHead(
  _In_ PLIST_ENTRY ListHead
);

Parameters

  • ListHead [in]
    Pointer to driver-allocated nonpaged storage for the head of the interlocked queue or list.

Return value

None

Remarks

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 miniport drivers.

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 must run at IRQL = PASSIVE_LEVEL, because this function is commonly called at initialization.

Requirements

Target platform

Desktop

Version

See NdisInitializeListHead.

Header

Ndis.h (include Ndis.h)

IRQL

PASSIVE_LEVEL

See also

DriverEntry of NDIS Protocol Drivers

MiniportInitialize

NdisAllocateSpinLock

NdisInterlockedInsertHeadList

NdisInterlockedInsertTailList

NdisInterlockedRemoveHeadList

 

 

Send comments about this topic to Microsoft