VOID
NdisInterlockedAddUlong(
IN PULONG Addend,
IN ULONG Increment,
IN PNDIS_SPIN_LOCK SpinLock
);
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.
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.
Callers of NdisInterlockedAddUlong run at IRQL <= DISPATCH_LEVEL.
NdisAcquireSpinLock, NdisAllocateSpinLock, NdisReleaseSpinLock, NdisRetrieveUlong, NdisStoreUlong