// wdm.h
LONG AddRaw(
LONG volatile *Destination,
LONG Value
);
View the official Windows Driver Kit DDI referenceNo description available.
AddRaw performs a raw addition operation on a volatile LONG value without atomic guarantees.
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.
Returns the new LONG value after the addition operation.
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.