// miniport.h
PVOID InterlockedCompareExchangePointer(
[in, out] PVOID volatile *Destination,
[in] PVOID Exchange,
PVOID Comperand
);
View the official Windows Driver Kit DDI reference
// wdm.h
PVOID InterlockedCompareExchangePointer(
[in, out] PVOID volatile *Destination,
[in] PVOID Exchange,
[in] PVOID Comperand
);
View the official Windows Driver Kit DDI reference
No description available.
The InterlockedCompareExchangePointer routine performs an atomic operation that compares the input pointer value pointed to by Destination with the pointer value Comparand.
Destination
[in, out]A pointer to a PVOID value. If (Destination) = *Comparand, then the routine sets (Destination) to *Exchange.
Exchange
[in]Specifies the PVOID value to set (*Destination) to.
Comperand
Specifies the PVOID value to compare with (*Destination).
InterlockedCompareExchangePointer returns the original value of the pointer at *Destination (that is, the value of this pointer at entry to the routine).
If Comparand is equal to *Destination, then *Destination is set to equal Exchange. Otherwise, *Destination is unchanged.
InterlockedCompareExchangePointer provides a fast, atomic way to synchronize the testing and updating of a pointer variable that is shared by multiple threads. If the input value pointed to by Destination equals the value of Comparand, the value pointed to by Destination is set to the value of Exchange.
InterlockedCompareExchangePointer is designed for speed and, typically, is implemented inline by a compiler. InterlockedCompareExchangePointer is atomic only with respect to other InterlockedXxx calls. It does not use a spin lock and can be safely used on pageable data.
The InterlockedCompareExchangePointer routine is atomic only with respect to other InterlockedXxx calls.
Interlocked operations cannot be used on non-cached memory.
The InterlockedCompareExchangePointer routine performs an atomic operation that compares the input pointer value pointed to by Destination with the pointer value Comperand.
Destination
[in, out]A pointer to a PVOID value. If (Destination) = *Comperand, then the routine sets (Destination) to *Exchange.
Exchange
[in]Specifies the PVOID value to set (*Destination) to.
Comperand
[in]Specifies the PVOID value to compare with (*Destination).
InterlockedCompareExchangePointer returns the original value of the pointer at *Destination (that is, the value of this pointer at entry to the routine).
If Comperand is equal to *Destination, then *Destination is set to equal Exchange. Otherwise, *Destination is unchanged.
InterlockedCompareExchangePointer provides a fast, atomic way to synchronize the testing and updating of a pointer variable that is shared by multiple threads. If the input value pointed to by Destination equals the value of Comperand, the value pointed to by Destination is set to the value of Exchange.
InterlockedCompareExchangePointer is designed for speed and, typically, is implemented inline by a compiler. InterlockedCompareExchangePointer is atomic only with respect to other InterlockedXxx calls. It does not use a spin lock and can be safely used on pageable data.
The InterlockedCompareExchangePointer routine is atomic only with respect to other InterlockedXxx calls.
Interlocked operations cannot be used on non-cached memory.