NdisInterlockedAddUlong macro (ndis.h)

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.

Syntax

void NdisInterlockedAddUlong(
  [in]  _Addend,
  [in]  _Increment,
  [in]  _SpinLock
);

Parameters

[in] _Addend

A pointer to the variable for which the value is to be adjusted by the given Increment .

[in] _Increment

The value to be added to that at Addend .

[in] _SpinLock

A pointer to a caller-initialized spin lock.

Return value

None

Remarks

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.

Requirements

Requirement Value
Minimum supported client Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisInterlockedAddUlong (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisInterlockedAddUlong (NDIS 5.1)) in Windows XP.
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL Any level

See also

NdisAcquireSpinLock

NdisAllocateSpinLock

NdisReleaseSpinLock

NdisRetrieveUlong

NdisStoreUlong