Export (0) Print
Expand All
Expand Minimize

InsertHeadList routine

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

Syntax


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

Parameters

ListHead [in, out]

Pointer to the LIST_ENTRY structure that represents the head of the list.

Entry [in, out]

Pointer to a LIST_ENTRY structure that represents the entry to be inserted into the list.

Return value

None

Remarks

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

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

IRQL

Any level (See Remarks section)

DDI compliance rules

IoAllocateFree, IoReuseIrp, MarkingQueuedIrps, RemoveLockForward, RemoveLockForward2, RemoveLockForwardDeviceControl, RemoveLockForwardDeviceControl2, RemoveLockForwardDeviceControlInternal, RemoveLockForwardDeviceControlInternal2, RemoveLockForwardRead, RemoveLockForwardRead2, RemoveLockForwardWrite, RemoveLockForwardWrite2, RemoveLockRelease2, RemoveLockReleaseCleanup, RemoveLockReleaseClose, RemoveLockReleaseCreate, RemoveLockReleaseDeviceControl, RemoveLockReleaseInternalDeviceControl, RemoveLockReleasePower, RemoveLockReleaseRead, RemoveLockReleaseShutdown, RemoveLockReleaseSystemControl, RemoveLockReleaseWrite

See also

ExInterlockedInsertHeadList
InitializeListHead
InsertTailList
IsListEmpty
RemoveHeadList
RemoveTailList

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft