The FillUserMemory function fills a user-mode memory region with a specified byte value.
Syntax
VOID FillUserMemory(
volatile VOID *Destination,
SIZE_T Length,
UCHAR Fill
);
Parameters
Destination
[out] 채울 메모리 블록의 시작 주소에 대한 포인터입니다.
Length
[in] The number of bytes to fill with the Fill value.
Fill
[in] The byte value used to fill the first Length bytes of Destination.
Return value
None
Remarks
이 함수는 사용자 모드 메모리 영역을 지정된 바이트 값으로 채우는 안전한 방법을 제공합니다. 이를 통해 커널 모드 코드가 사용자 모드 메모리 버퍼를 초기화해야 하는 경우 유연한 메모리 작업을 수행할 수 있습니다.
함수에는 다음과 같은 속성이 있습니다.
The function performs a fill using memory_order_relaxed semantics.
함수는 컴파일러 내장 함수로 인식되지 않으므로 컴파일러가 호출을 최적화하지 않습니다(완전히 또는 동일한 명령 시퀀스로 호출 대체).
When the call returns, the buffer has been overwritten with the specified Fill value. This function's memory accesses to the Destination will only be performed within the function (for example, the compiler can't move memory accesses out of this function).
플랫폼이 허용하는 경우 함수는 정렬되지 않은 메모리 액세스를 수행할 수 있습니다.
함수는 채우기 작업의 일부로 메모리 위치에 두 번 이상 액세스할 수 있습니다.
이 함수는 대상 주소가 유효한 사용자 모드 주소가 아니거나 액세스할 수 없는 경우와 같이 채우기 작업이 실패하는 경우 구조적 예외를 발생합니다.
이 함수는 최신 버전뿐만 아니라 모든 버전의 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 작거나 같음 |