Expand Minimize

ExInterlockedPushEntrySList routine

The ExInterlockedPushEntrySList routine atomically inserts an entry at the beginning of a sequenced singly linked list.

Syntax


PSLIST_ENTRY ExInterlockedPushEntrySList(
  _Inout_  PSLIST_HEADER ListHead,
  _Inout_  PSLIST_ENTRY ListEntry,
  _Inout_  PKSPIN_LOCK Lock
);

Parameters

ListHead [in, out]

A pointer to the SLIST_HEADER structure that serves as the header for the sequenced singly linked list. ListHead must have been initialized by calling ExInitializeSListHead.

ListEntry [in, out]

A pointer to the caller-allocated entry to be inserted.

Lock [in, out]

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

ExInterlockedPushEntrySList 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

For more information about using this routine to implement a sequenced singly linked list, see Singly and Doubly Linked Lists.

On Windows 2000, drivers must use the -D_WIN2K_COMPAT_SLIST_USAGE switch to successfully link code that uses ExInterlockedPushEntrySList.

The ExInterlockedPushEntrySList routine can be called at any IRQL. The storage for the ListHead parameter and the list entries must be resident at all IRQLs.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

Any level (see Remarks section)

See also

ExInitializeSListHead
ExInterlockedInsertTailList
ExInterlockedPopEntrySList
ExQueryDepthSList
KeInitializeSpinLock

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.