PopEntryList - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#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;
}

#endif

View code on GitHub
// wdm.h

PSINGLE_LIST_ENTRY PopEntryList(
  [in, out] PSINGLE_LIST_ENTRY ListHead
);

View the official Windows Driver Kit DDI reference

NtDoc

This function is documented in Windows Driver Kit.

Windows Driver Kit DDI reference (nf-wdm-popentrylist)

PopEntryList function

Description

The PopEntryList routine removes the first entry from a singly linked list of SINGLE_LIST_ENTRY structures.

Parameters

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.

Return value

PopEntryList returns a pointer to the entry removed from the list, or NULL if the list is currently empty.

Remarks

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.

See also

ExInterlockedPopEntryList

PushEntryList