interlocked_compare_exchange

Description of the 'interlocked_compare_exchange' function in HyperDbg Scripts

Function

interlocked_compare_exchange

Syntax

interlocked_compare_exchange( *Variable, Expression, Expression );

Parameters

[*Variable (Destination)]

A reference to a variable (most of the time a global variable) that is compared with the value of Comperand.

[Expression (ExChange)]

Specifies the output value pointed to by Destination if the input value pointed to by Destination equals the value of Comperand.

[Expression (Comperand)]

Specifies the value that is compared with the input value pointed to by Destination.

Description

Performs an atomic operation that compares the input value pointed to by Destination with the value of Comperand. If Comperand is equal to Destination, then Destination is set to equal Exchange. Otherwise, Destination is unchanged.

Return value

The function returns the original value of *Destination.

Examples

None

Remarks

None

interlocked_exchange_add

interlocked_increment

interlocked_exchange

interlocked_decrement

Last updated