#ifndef _NTRTL_H
FORCEINLINE
PSINGLE_LIST_ENTRY
NTAPI_INLINE
PopEntryList(
_Inout_ PSINGLE_LIST_ENTRY ListHead
)
{
PSINGLE_LIST_ENTRY FirstEntry;
FirstEntry = ListHead->Next;
if (FirstEntry)
ListHead->Next = FirstEntry->Next;
return FirstEntry;
}
View code on GitHub
// wdm.h
PSINGLE_LIST_ENTRY PopEntryList(
[in, out] PSINGLE_LIST_ENTRY ListHead
);
View the official Windows Driver Kit DDI reference
This function is documented in Windows Driver Kit.
The PopEntryList routine removes the first entry from a singly linked list of SINGLE_LIST_ENTRY structures.
ListHead
[in, out]Pointer to the SINGLE_LIST_ENTRY structure that represents the head of the list. On return, ListHead->Next points to the beginning of the list with the first entry removed.
PopEntryList returns a pointer to the entry removed from the list, or NULL if the list is currently empty.
PopEntryList removes the first entry from the list by setting ListHead->Next to point to the second entry in the list.
For information about using this routine when implementing a singly linked list, see Singly and Doubly Linked Lists.
Callers of PopEntryList can be running at any IRQL. If PopEntryList is called at IRQL >= DISPATCH_LEVEL, the storage for ListHead and the list entries must be resident.