Windows Driver Kit: Kernel-Mode Driver Architecture
ExInterlockedPushEntryList
The ExInterlockedPushEntryList routine atomically inserts an entry at the beginning of a singly linked list of SINGLE_LIST_ENTRY structures.
PSINGLE_LIST_ENTRY
ExInterlockedPushEntryList(
IN PSINGLE_LIST_ENTRY ListHead,
IN PSINGLE_LIST_ENTRY ListEntry,
IN PKSPIN_LOCK Lock
);
Parameters
- ListHead
- A pointer to the SINGLE_LIST_ENTRY structure that serves as the list header.
- ListEntry
- A pointer to the SINGLE_LIST_ENTRY structure that represents the entry to be inserted into the list.
- Lock
- A pointer to a KSPIN_LOCK structure that serves as the spin lock used to synchronize access to the list. The storage for the spin lock must be resident and must have been initialized by calling KeInitializeSpinLock. You must use this spin lock only with the ExInterlockedXxxList routines.
Return Value
ExInterlockedPushEntryList returns a pointer to the first entry of the list before the new entry was inserted. If the list was empty, the routine returns NULL.
Comments
ExInterlockedPushEntryList performs the same operation as PushEntryList, but atomically. Do not mix atomic and non-atomic calls on the same list.
For more information about using this routine to implement a singly linked list, see Singly and Doubly Linked Lists.
The ExInterlockedPushEntryList routine can be called at any IRQL. The storage for the ListHead parameter and the list entries must be resident at all IRQLs.
Requirements
IRQL: Any level (see Comments section)
Headers: Declared in Wdm.h. Include Wdm.h, Ntddk.h, or Ntifs.h.
See Also
ExInitializeSListHead, ExInterlockedInsertTailList, ExInterlockedPopEntryList, ExInterlockedPushEntrySList, KeInitializeSpinLock, PushEntryList