NdisInterlockedPushEntrySList function

The NdisInterlockedPushEntrySList function inserts an entry at the head of a sequenced, singly linked list.

Syntax


PSINGLE_LIST_ENTRY NdisInterlockedPushEntrySList(
  _In_ PSLIST_HEADER      ListHead,
  _In_ PSINGLE_LIST_ENTRY ListEntry,
  _In_ PNDIS_SPIN_LOCK    Lock
);

Parameters

ListHead [in]

A pointer to the head of the already initialized sequenced, singly linked list into which the specified entry is to be inserted.

ListEntry [in]

A pointer to the entry to be inserted.

Lock [in]

A pointer to a caller-supplied spin lock, not currently held by the caller.

Return value

NdisInterlockedPushEntrySList returns a pointer to the previous first entry in the list. If the list was previously empty, it returns NULL.

Remarks

Before the driver's initial call the NdisInterlockedPushEntrySList function, it must initialize the list head with the NdisInitializeSListHead function.

A driver must not be holding the given Lock when it calls NdisInterlockedPushEntrySList. If necessary, a driver must call the NdisReleaseSpinLock function before calling NdisInterlockedPushEntrySList. NdisInterlockedPushEntrySList must acquire this lock itself before it inserts ListEntry at the head of the list to ensure that this operation is handled in a multiprocessor-safe way.

The caller must provide resident storage for the Lock, which must be initialized with the NdisAllocateSpinLock function before the initial call to any NdisInterlocked..SList routine.

Drivers that retry I/O operations should use a doubly linked interlocked queue and the NdisInterlockedInsert/Remove..List functions, instead of an S-List.

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

Requirements

Target platform

Desktop

Version

Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisInterlockedPushEntrySList (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisInterlockedPushEntrySList (NDIS 5.1)) in Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

Any level

See also

NdisAllocateSpinLock
NdisFreeSpinLock
NdisInitializeSListHead
NdisInterlockedPopEntrySList
NdisReleaseSpinLock
NdisQueryDepthSList

 

 

Send comments about this topic to Microsoft

Show: