NdisInterlockedAddUlong (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.
NdisInterlockedAddUlong adds an unsigned long value to a given unsigned integer as an atomic operation, using a caller-supplied spin lock to synchronize access to the integer variable.
Syntax
VOID NdisInterlockedAddUlong(
_In_ PULONG Addend,
_In_ ULONG Increment,
_In_ PNDIS_SPIN_LOCK SpinLock
);
Parameters
Addend [in]
Pointer to the variable for which the value is to be adjusted by the given Increment.Increment [in]
Specifies the value to be added to that at Addend.SpinLock [in]
Pointer to a caller-initialized spin lock.
Return value
None
Remarks
The caller must provide resident storage for the spin lock, which must be initialized with NdisAllocateSpinLock before the initial call to NdisInterlockedAddUlong.
The SpinLock passed to NdisInterlockedAddUlong is used to assure that the addition to the variable at Addend is atomic with respect to any other operations on the same variable that synchronize with the same spin lock.
NdisInterlockedAddUlong raises IRQL to DISPATCH_LEVEL when it acquires the given spin lock and restores the original IRQL before it returns control. Consequently, any driver function that calls NdisInterlockedAddUlong cannot be pageable code.
Requirements
Target platform |
Universal |
Version |
|
Header |
Ndis.h (include Ndis.h) |
Library |
Ndis.lib |
IRQL |
<= DISPATCH_LEVEL |
See also