LONG
InterlockedExchange(
IN OUT PLONG Target,
IN LONG Value
);
InterlockedExchange sets an integer variable to a specified value as an atomic operation.
InterlockedExchange returns the original (unset) value of the Target variable.
This routine should be used in place of the previous ExInterlockedExchangeUlong. The new routine is faster and more efficient. It 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.
The InterlockedExchange routine is atomic only with respect to other InterlockedXxxxxx calls.
Callers of InterlockedExchange run at any IRQL.
InterlockedIncrement, InterlockedDecrement, ExInterlockedAddLargeInteger, ExInterlockedAddUlong