// ndis.h
void NdisInterlockedAddUlong(
[in] _Addend,
[in] _Increment,
[in] _SpinLock
);
View the official Windows Driver Kit DDI referenceNo description available.
The NdisInterlockedAddUlong function 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.
_Addend [in]A pointer to the variable for which the value is to be adjusted by the given Increment .
_Increment [in]The value to be added to that at Addend .
_SpinLock [in]A pointer to a caller-initialized spin lock.
The caller of NdisInterlockedAddUlong must provide resident storage for the spin lock, which must be initialized with the NdisAllocateSpinLock function before the initial call to NdisInterlockedAddUlong.
The SpinLock value that is passed to the NdisInterlockedAddUlong function is used to assure that the addition to the variable at the Addend parameter is atomic with respect to any other operations on the same variable that synchronize with the same spin lock.
NdisInterlockedAddUlong raises the 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.