NdisInterlockedInsertTailList - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ndis.h

void NdisInterlockedInsertTailList(
  [in] _ListHead,
  [in] _ListEntry,
  [in] _SpinLock
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ndis-ndisinterlockedinserttaillist)

NdisInterlockedInsertTailList macro

Description

The NdisInterlockedInsertTailList function inserts an entry, usually a packet, at the tail of a doubly linked list so that access to the list is synchronized in a multiprocessor-safe way.

Parameters

_ListHead [in]

A pointer to the head of the doubly linked list into which an entry is to be inserted.

_ListEntry [in]

A pointer to the entry to be inserted at the end of the list.

_SpinLock [in]

A pointer to a caller-supplied spin lock, used to synchronize access to the list.

Remarks

Before calling NdisInterlockedInsertTailList, a driver must initialize the variable at ListHead with the NdisInitializeListHead function and the variable at SpinLock with the NdisAllocateSpinLock function. The driver also must provide resident storage for these variables and for its internal queue.

The caller-supplied spin lock prevents any other function from accessing the driver's internal queue while NdisInterlockedInsertTailList is inserting the given entry, even when the driver is running on a multiprocessor machine.

NdisInterlockedInsertTailList raises the IRQL to DISPATCH_LEVEL when it acquires the given spin lock and restores the original IRQL before it returns control. Consequently, any driver function that calls NdisInterlockedInsertTailList cannot be pageable code.

To convert a returned value back to the address of the inserted entry, a driver can use the CONTAINING_RECORD macro.

If NdisInterlockedInsertTailList is called at IRQL >= DISPATCH_LEVEL, the storage for the ListHead parameter and the list entries must be resident.

See also

CONTAINING_RECORD

NdisAllocateSpinLock

NdisInitializeListHead

NdisInterlockedInsertHeadList

NdisInterlockedRemoveHeadList