Previous Next

RemoveHeadList

The RemoveHeadList routine removes an entry from the head of a doubly linked list.

PLIST_ENTRY 
  RemoveHeadList(
    IN PLIST_ENTRY  ListHead
    );

Parameters

ListHead
Pointer to the driver-allocated storage for a doubly linked list with entries of type LIST_ENTRY.

Return Value

RemoveHeadList returns a pointer to the entry that was at the head of the list.

Headers

Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.

Comments

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.

See Also

ExInterlockedRemoveHeadList, InitializeListHead, IsListEmpty, RemoveTailList, RemoveEntryList