VOID
ExInitializeSListHead(
IN PSLIST_HEADER SListHead
);
ExInitializeSListHead initializes the list header for a sequenced, interlocked, singly linked list.
Parameters
SListHead
Points to the caller-supplied list header to be initialized. The list header must be allocated from nonpaged memory and is defined as follows:
typedef union _SLIST_HEADER {
ULONGLONG Alignment;
struct {
SINGLE_LIST_ENTRY Next;
USHORT Depth;
USHORT Sequence;
};
} SLIST_HEADER, *PSLIST_HEADER;
Return Value
None.
Comments
ExInitializeSListHead zeros the depth and sequence number in SListHead and sets the first-entry pointer to NULL.
The sequence number in an S-List is incremented each time an entry is inserted to, or removed from, the list.
Entries in an S-List must be nonpaged. Users of an S-List must provide a spin lock to ExInterlockedPushEntrySList and ExInterlockedPopEntrySList. The OS may or may not use the spin lock, but it must be provided. For optimal performance, the OS uses an 8-byte compare exchange operation to synchronize access to the S-List if such an instruction is available. On platforms that do not support such an instruction, the spin lock is used. Callers of ExInterlocked..SList should make no assumptions about whether the spin lock will be used.
To manage a pool of fixed-size entries from either paged or nonpaged memory, consider using lookaside lists (Ex..LookasideList).
Drivers that retry I/O operations should use a doubly linked interlocked queue and the ExInterlockedInsert/Remove..List routines.
Callers of ExInitializeSListHead should be running at IRQL <= DISPATCH_LEVEL.
See Also
ExInitializeNPagedLookasideList, ExInitializePagedLookasideList, ExInterlockedPopEntrySList, ExInterlockedPushEntrySList, ExQueryDepthSListHead, ExQueueWorkItem