InsertHeadList
Windows Driver Kit: Kernel-Mode Driver Architecture
InsertHeadList

The InsertHeadList routine inserts an entry at the head of a doubly linked list of LIST_ENTRY structures.

VOID 
  InsertHeadList(
    IN PLIST_ENTRY  ListHead,
    IN PLIST_ENTRY  Entry
    );

Parameters

ListHead
Pointer to the LIST_ENTRY structure that represents the head of the list.
Entry
Pointer to a LIST_ENTRY structure that represents the entry to be inserted into the list.

Return Value

None

Comments

InsertHeadList updates ListHead->Flink to point to Entry. It updates Entry->Flink to point to the old first entry in the list, and sets Entry->Blink to ListHead. The Blink field of the original first entry is also updated to point to Entry.

For information about using this routine when implementing a doubly linked list, see Singly and Doubly Linked Lists.

Callers of InsertHeadList can be running at any IRQL. If InsertHeadList is called at IRQL >= DISPATCH_LEVEL the storage for ListHead and the list entries must be resident.

Requirements

IRQL: Any level (See Comments section)

Headers: Declared in Wdm.h. Include Wdm.h, Ntddk.h, or Ntifs.h.

See Also

ExInterlockedInsertHeadList, InitializeListHead, InsertTailList, IsListEmpty, RemoveHeadList, RemoveTailList


Send feedback on this topic
Built on November 19, 2009
Page view tracker