// wdm.h
ULONG AddULongRaw(
ULONG volatile *Destination,
ULONG Value
);
View the official Windows Driver Kit DDI referenceNo description available.
AddULongRaw performs a raw addition operation on a volatile ULONG value without atomic guarantees.
Destination[in, out] A pointer to the volatile ULONG variable to modify. This parameter serves as both the source and destination for the addition operation.
Value[in] The ULONG value to add to the destination.
Returns the new ULONG value after the addition operation.
The AddULongRaw function performs a non-atomic read-add-write operation on unsigned long values. This function internally casts the ULONG pointers to LONG pointers and calls AddRaw, then casts the result back to ULONG.
This function is not atomic and should not be used in multithreaded scenarios where multiple threads might access the same memory location. The operation consists of separate read and write operations that can be interrupted.