Previous Next

ExInitializeSListHead

The ExInitializeSListHead routine initializes the head of a sequenced, interlocked, singly linked list.

VOID 
  ExInitializeSListHead(
    IN PSLIST_HEADER  SListHead
    );

Parameters

SListHead
Pointer to caller-supplied memory for the list head to be initialized. The caller must provide at least sizeof(SLIST_HEADER) in nonpaged memory for this opaque list head.

Return Value

None

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

ExInitializeSListHead initializes the system-maintained state for the S-List and sets the first-entry pointer to NULL. The caller must provide resident storage for and initialize a spin lock with KeInitializeSpinLock before inserting any caller-allocated entry into its initialized S-List.

The sequence number for an S-List is incremented each time an entry is inserted into or removed from the S-List. To determine the number of entries currently in an S-List, call ExQueryDepthSList.

Subsequent calls to ExInterlockedPushEntrySList and ExInterlockedPopEntrySList insert and remove caller-allocated entries into and from the S-List. All entries for an S-List must be allocated from nonpaged pool.

Drivers that retry I/O operations should use a doubly linked interlocked queue and the ExInterlockedInsert/Remove..List routines, rather than an S-List.

To manage a dynamically sized set of fixed-size entries, consider setting up a lookaside list with ExInitializeNPageLookasideList or ExInitializePagedLookasideList, instead of using an S-List.

Callers of ExInitializeSListHead must be running at IRQL <= DISPATCH_LEVEL.

See Also

ExInitializeNPagedLookasideList, ExInitializePagedLookasideList, ExInterlockedInsertTailList, ExInterlockedPopEntrySList, ExInterlockedPushEntrySList, ExQueryDepthSList, ExQueueWorkItem, KeInitializeSpinLock