Microsoft Windows CE 3.0  


This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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

PLIST_ENTRY NdisInterlockedInsertHeadList(


Pointer to the head of the doubly linked list into which an entry is to be inserted.
Pointer to the entry to be inserted at the head of the list.
Pointer to a caller-supplied spin lock used to synchronize access to the list.

Return Values

Returns a pointer to the entry that was at the head of the queue before the specified entry was inserted. If the queue was empty, it returns NULL.


Before calling this function, a driver must initialize the variable at ListHeadwith the NdisInitializeListHeadfunction and the variable at SpinLockwith the NdisAllocateSpinLockfunction. The driver must also 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 this function is inserting the specified entry, even when the driver is running on a multiprocessor machine.

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

Most NDIS drivers process packets in first-in, first-out (FIFO) order, so any driver that uses an interlocked queue tends to call the NdisInterlockedInsertTailListfunction far more frequently than this function. Such a driver usually calls this function only to requeue a packet for a retry operation.

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

A driver that calls this function runs at IRQL <= DISPATCH_LEVEL.


Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisAllocateSpinLock, NdisInitializeListHead, NdisInterlockedInsertTailList, NdisInterlockedRemoveHeadList

 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.