다음을 통해 공유


NdisInterlockedPushEntrySList (Compact 2013)

3/26/2014

This 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 PKSPIN_LOCK  Lock
    );

Parameters

  • ListHead
    A pointer to the head of the already initialized sequenced, singly linked list into which the specified entry is to be inserted.
  • ListEntry
    A pointer to the entry to be inserted.
  • Lock
    A pointer to a caller-supplied spin lock, currently not 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 it is necessary, a driver must call the NdisReleaseSpinLock function before they call NdisInterlockedPushEntrySList. NdisInterlockedPushEntrySList must obtain this lock itself before it inserts ListEntry at the head of the list to make sure 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.

Requirements

Header

ndis.h

See Also

Reference

NDIS Interlocked Functions Interface
NdisAllocateSpinLock
NdisFreeSpinLock
NdisInitializeSListHead
NdisInterlockedPopEntrySList
NdisReleaseSpinLock
NdisQueryDepthSList