ExInterlockedPushEntryList function (wdm.h)

The ExInterlockedPushEntryList routine atomically inserts an entry at the beginning of a singly linked list of SINGLE_LIST_ENTRY structures.

Syntax

PSINGLE_LIST_ENTRY ExInterlockedPushEntryList(
  [in, out] PSINGLE_LIST_ENTRY                  ListHead,
  [in, out] __drv_aliasesMem PSINGLE_LIST_ENTRY ListEntry,
  [in, out] PKSPIN_LOCK                         Lock
);

Parameters

[in, out] ListHead

A pointer to the SINGLE_LIST_ENTRY structure that serves as the list header. The storage for ListHead must be resident at all IRQLs.

[in, out] ListEntry

A pointer to the SINGLE_LIST_ENTRY structure that represents the entry to be inserted into the list. The storage for ListEntry must be resident at all IRQLs.

[in, out] 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.

Remarks

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

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level (see Remarks section)
DDI compliance rules IoAllocateFree(wdm), IoReuseIrp(wdm), MarkingInterlockedQueuedIrps(wdm), RemoveLockCheck(wdm), RemoveLockForward(wdm), RemoveLockForward2(wdm), RemoveLockForwardDeviceControl(wdm), RemoveLockForwardDeviceControl2(wdm), RemoveLockForwardDeviceControlInternal(wdm), RemoveLockForwardDeviceControlInternal2(wdm), RemoveLockForwardRead(wdm), RemoveLockForwardRead2(wdm), RemoveLockForwardWrite(wdm), RemoveLockForwardWrite2(wdm), RemoveLockRelease2(wdm), RemoveLockReleaseCleanup(wdm), RemoveLockReleaseClose(wdm), RemoveLockReleaseCreate(wdm), RemoveLockReleaseDeviceControl(wdm), RemoveLockReleaseInternalDeviceControl(wdm), RemoveLockReleasePower(wdm), RemoveLockReleaseRead(wdm), RemoveLockReleaseShutdown(wdm), RemoveLockReleaseSystemControl(wdm), RemoveLockReleaseWrite(wdm)

See also

ExInitializeSListHead

ExInterlockedInsertTailList

ExInterlockedPopEntryList

ExInterlockedPushEntrySList

KeInitializeSpinLock

PushEntryList