NdisInterlockedPushEntrySList (NDIS 5.1) function
Note NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.
NdisInterlockedPushEntrySList 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]
Pointer to the head of the already initialized sequenced, singly linked list into which the specified entry is to be inserted.ListEntry [in]
Pointer to the entry to be inserted.Lock [in]
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 this function, it must initialize the list head with NdisInitializeSListHead.
A driver must not be holding the given Lock when it calls NdisInterlockedPushEntrySList. If necessary, a driver must call NdisReleaseSpinLock before making this call. 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 NdisAllocateSpinLock 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.
Requirements
Target platform |
Desktop |
Version |
|
Header |
Ndis.h (include Ndis.h) |
IRQL |
<= DISPATCH_LEVEL |
See also