ExInterlockedAddLargeInteger function (wdm.h)

The ExInterlockedAddLargeInteger routine adds a large integer value to the specified variable as an atomic operation.

Syntax

LARGE_INTEGER ExInterlockedAddLargeInteger(
  [in, out] PLARGE_INTEGER Addend,
  [in]      LARGE_INTEGER  Increment,
  [in, out] PKSPIN_LOCK    Lock
);

Parameters

[in, out] Addend

A pointer to the variable to be adjusted by the Increment value.

[in] Increment

Specifies a value to be added to Addend.

[in, out] Lock

A pointer to a spin lock to be used to synchronize access to Addend.

Return value

ExInterlockedAddLargeInteger returns the initial value of the Addend parameter.

Remarks

Support routines that do interlocked operations are assumed to be incapable of causing a page fault. That is, neither their code nor any of the data they touch can cause a page fault without bringing down the system. They use spin locks to achieve atomicity on symmetric multiprocessor machines. The caller must provide resident storage for the Lock, which must be initialized with KeInitializeSpinLock before the initial call to an ExInterlockedXxx.

The Lock passed to ExInterlockedAddLargeInteger is used to assure that the add operation on Addend is atomic with respect to any other operations on the same value which synchronize with this same spin lock.

ExInterlockedAddLargeInteger masks interrupts. Consequently, it can be used for synchronization between an ISR and other device driver code, provided that the same Lock is never reused in a call to a routine that runs at IRQL = DISPATCH_LEVEL.

Note that calls to InterlockedXxx are guaranteed to be atomic with respect to other InterlockedXxx calls without caller-supplied spin locks.

Callers of ExInterlockedAddLargeInteger run at any IRQL. The storage for the Addend parameter must be resident at all IRQLs.

Requirements

Requirement Value
Minimum supported client Available in Windows 2000 and later versions of Windows. Not available in Windows 98 or Windows Me.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level (see Remarks section)

See also

ExInterlockedAddUlong

InterlockedDecrement

InterlockedIncrement

KeInitializeSpinLock