Share via


NdisInterlockedRemoveHeadList (Windows Embedded CE 6.0)

1/6/2010

This function removes an entry, usually a packet, from the head of a doubly linked list so that access to the list is synchronized.

Syntax

PLIST_ENTRY NdisInterlockedRemoveHeadList(
  PLIST_ENTRY ListHead,
  PNDIS_SPIN_LOCK SpinLock
);

Parameters

  • ListHead
    [in] Pointer to the head of the doubly linked list from which an entry is to be removed.
  • SpinLock
    [in] Pointer to a caller-supplied spin lock used to synchronize access to the list.

Return Value

Returns a pointer to the dequeued entry. If the list is empty, it returns NULL.

Remarks

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

Before calling this function, entries are queued with one or more calls to the NdisInterlockedInsertXXXList functions.

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

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

Requirements

Header ndis.h
Library ndis.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Library Functions
NdisAllocateSpinLock
NdisInitializeListHead
NdisInterlockedInsertHeadList
NdisInterlockedInsertTailList