Previous Next

ExInterlockedPushEntrySList

The ExInterlockedPushEntrySList routine inserts an entry at the head of a sequenced, singly linked list so that access to the queue is synchronized in a multiprocessor-safe way.

PSINGLE_LIST_ENTRY 
  ExInterlockedPushEntrySList(
    IN PSLIST_HEADER  ListHead,
    IN PSINGLE_LIST_ENTRY  ListEntry,
    IN PKSPIN_LOCK  Lock
    );

Parameters

ListHead
Pointer to the head of the sequenced, singly linked list into which the specified entry is to be inserted. The given list head must be in nonpaged system space and initialized with ExInitializeSListHead before the first call to ExInterlockedPushEntrySList.
ListEntry
Pointer to the caller-allocated entry to be inserted.
Lock
Pointer to a caller-supplied spin lock, which must be initialized with KeInitializeSpinLock before the first call to ExInterlockedPushEntrySList.

Return Value

ExInterlockedPushEntrySList returns a pointer to the previous first entry in the list, if any. If the list was empty, it returns NULL.

Headers

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

Comments

ExInterlockedPushEntrySList inserts ListEntry at the head of the list. Before each call to this routine, the caller either allocates the entry to be inserted or reinserts an entry obtained from a preceding call to ExInterlockedPopEntrySList. All entries in a sequenced, singly linked interlocked queue 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.

The caller must provide resident storage for the ListHead and Lock, which must be initialized before the first call to ExInterlockedPushSList. A caller must not be holding this spin lock when it calls ExInterlockedPush/PopEntrySList routine.

Callers of ExInterlockedPushEntrySList should be running at IRQL <= DISPATCH_LEVEL.

See Also

ExInitializeSListHead, ExInterlockedInsertTailList, ExInterlockedPopEntrySList, ExQueryDepthSList, KeInitializeSpinLock