The RemoveHeadList routine removes an entry from the head of a doubly linked list.
PLIST_ENTRY
RemoveHeadList(
IN PLIST_ENTRY ListHead
);
RemoveHeadList returns a pointer to the entry that was at the head of the list.
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
Calling RemoveHeadList with an empty list can cause a system failure. Callers of RemoveHeadList should first call IsListEmpty to determine if the list has any entries.
Callers of RemoveHeadList can be running at IRQL >= DISPATCH_LEVEL only if the caller-allocated storage for ListHead is resident, and only if pointers to every list entry remain valid at IRQL >= DISPATCH_LEVEL as well.
This routine provides no inherent synchronization for the LIST_ENTRY that is being removed from the list.
ExInterlockedRemoveHeadList, InitializeListHead, IsListEmpty, RemoveTailList, RemoveEntryList