The ExInterlockedRemoveHeadList routine removes an entry from the beginning of a doubly linked list of LIST_ENTRY structures.
NTKERNELAPI PLIST_ENTRY ExInterlockedRemoveHeadList( PLIST_ENTRY ListHead, _Requires_lock_not_held_(*_Curr_)PKSPIN_LOCK Lock );
A pointer to the LIST_ENTRY structure that serves as the list header.
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.
ExInterlockedRemoveHeadList returns a pointer to the LIST_ENTRY structure removed from the list. If the list was empty, the routine returns NULL.
ExInterlockedRemoveHeadList performs a similar operation as RemoveHeadList, but atomically. Do not mix atomic and non-atomic calls on the same list.
For more information about using this routine to implement a doubly linked list, see Singly and Doubly Linked Lists.
The ExInterlockedRemoveHeadList routine can be called at any IRQL. The storage for the ListHead parameter must be resident at all IRQLs.
|Windows version||Available starting with Windows 2000.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|IRQL||Any level (see Remarks section)|