InterlockedDecrement function

The InterlockedDecrement routine decrements a caller-supplied variable of type LONG as an atomic operation.

Syntax

LONG CDECL_NON_WVMPURE InterlockedDecrement(
  LONG volatile *Addend
);

Parameters

Addend

A pointer to a variable to be decremented.

Return Value

InterlockedDecrement returns the decremented value.

Remarks

InterlockedDecrement should be used instead of ExInterlockedDecrementLong because it is both more efficient and faster.

InterlockedDecrement is implemented inline by the compiler when appropriate and possible. It does not require a spin lock and can therefore be safely used on pageable data.

InterlockedDecrement is atomic only with respect to other InterlockedXxx calls.

Interlocked operations cannot be used on non-cached memory.

Requirements

   
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h, Miniport.h)
Library OneCoreUAP.lib on Windows 10
IRQL Any level

See Also

ExInterlockedAddLargeInteger

ExInterlockedAddUlong

InterlockedExchange

InterlockedIncrement