Edit

Share via


AddRaw function (wdm.h)

AddRaw performs a raw addition operation on a volatile LONG value without atomic guarantees.

Syntax

LONG AddRaw(
  LONG volatile *Destination,
  LONG          Value
);

Parameters

Destination

[in, out] A pointer to a volatile LONG variable to modify. This parameter serves as both the source and destination for the addition operation.

Value

[in] The LONG value to add to the destination.

Return value

Returns the new LONG value after the addition operation.

Remarks

The AddRaw function performs a non-atomic read-add-write operation. It reads the current value from the destination, adds the specified value, writes the result back, and returns the new value.

This function is not atomic and should not be used in multithreaded scenarios where multiple reads might access the same memory location. The operation consists of separate read and write operations that can be interrupted.

Requirements

Requirement Value
Header wdm.h
IRQL Any level

See also

AddRaw64

AddULongRaw

ReadRaw

WriteRaw