Edit

Share via


InterlockedOr64ToUser function (usermode_accessors.h)

The InterlockedOr64ToUser function performs an atomic OR operation on a 64-bit value in user-mode memory.

Syntax

LONG64 InterlockedOr64ToUser(
  LONG64 volatile *Destination,
  LONG64          Value
);

Parameters

Destination

[in, out] A pointer to the user-mode memory ___location containing the first operand. This value will be replaced with the result of the operation. The pointer must be naturally aligned for the data type; that is, the memory ___location must be 8-byte aligned since Destination points to an 8-byte type.

Value

[in] The second operand.

Return value

The function returns the original value of the Destination parameter.

Remarks

The interlocked functions provide a simple mechanism for synchronizing access to a variable that is shared by multiple threads. This function is atomic with respect to calls to other interlocked functions. It generates a full memory barrier to ensure that memory operations are completed in order.

This function provides atomic access to a 64-bit value in user-mode memory, performing a bitwise OR operation between the value at Destination and Value.

The function raises a structured exception if the operation fails, such as when the destination address is not a valid user-mode address or is inaccessible.

This function works on all versions of Windows, not just the latest. You need to consume the latest WDK to get the function declaration from the usermode_accessors.h header. You also need the library (umaccess.lib) from the latest WDK. However, the resulting driver will run fine on older versions of Windows.

Requirements

Requirement Value
Minimum supported client See Remarks
Header usermode_accessors.h
Library umaccess.lib
IRQL Less than or equal to APC_LEVEL

See also

InterlockedOr64ToMode

InterlockedOrToUser

InterlockedAnd64ToUser