다음을 통해 공유


InterlockedOr64ToMode 함수(usermode_accessors.h)

The InterlockedOr64ToMode function performs an atomic OR operation on a 64-bit value, based on the specified processor mode.

Syntax

LONG64 InterlockedOr64ToMode(
  LONG64 volatile *Destination,
  LONG64          Value,
  KPROCESSOR_MODE Mode
);

Parameters

Destination

[in, out] 첫 번째 피연산자를 포함하는 메모리 위치에 대한 포인터입니다. 이 값은 작업의 결과로 대체됩니다. 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] 두 번째 피연산자입니다.

Mode

[in] 메모리 액세스가 수행되는 방법을 결정하는 프로세서 모드입니다. Mode can be one of the following values.

Value Meaning
KernelMode Destination points to kernel-mode memory. 이 함수는 직접 원자성 OR 연산을 수행합니다. 자세한 내용은 비고를 참조하세요.
UserMode Destination points to user-mode memory. The function raises an exception if Destination doesn't point to user-mode memory; otherwise it performs an atomic OR operation at the specified address. 자세한 내용은 비고를 참조하세요.

Return value

The function returns the original value of the Destination parameter.

Remarks

연동 함수는 여러 스레드에서 공유하는 변수에 대한 액세스를 동기화하는 간단한 메커니즘을 제공합니다. 이 함수는 다른 연동 함수에 대한 호출과 관련하여 원자성입니다. 메모리 작업이 순서대로 완료되도록 전체 메모리 장벽을 생성합니다.

This function provides atomic access to a 64-bit value in memory, performing a bitwise OR operation between the value at Destination and Value. 동작은 지정된 프로세서 모드에 따라 달라집니다.

  • When Mode is UserMode, the function ensures that the destination address is a valid user-mode address and performs the operation safely for user-mode memory access.
  • When Mode is KernelMode, the function operates directly on kernel-mode addresses.

이 함수는 대상 주소에 액세스할 수 없거나 지정된 모드에 대해 유효하지 않은 경우와 같이 작업이 실패할 경우 구조적 예외를 발생합니다.

이 함수는 최신 버전뿐만 아니라 모든 버전의 Windows에서 작동합니다. 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. 그러나 결과 드라이버는 이전 버전의 Windows에서 잘 실행됩니다.

Requirements

Requirement Value
지원되는 최소 클라이언트 See Remarks
Header usermode_accessors.h
Library umaccess.lib
IRQL APC_LEVEL 작거나 같음

See also

InterlockedOr64ToUser

InterlockedOrToMode

InterlockedAnd64ToMode