Edit

Share via


ReadStructFromModeHelper function (usermode_accessors.h)

The ReadStructFromModeHelper function is a helper function that safely reads a structure of a specified size from memory based on the specified processor mode.

Syntax

FORCEINLINE
NTSTATUS
ReadStructFromModeHelper (
    _Out_ PVOID Destination,
    _In_ const PVOID Source,
    _In_ SIZE_T Length,
    _In_ KPROCESSOR_MODE Mode
    );

Parameters

Destination

[out] A pointer to the buffer that receives the data read from memory.

Source

[in] A pointer to the memory ___location from which to read the data.

Size

[in] The size, in bytes, of the data to read.

Mode

[in] The processor mode that determines how the memory access is performed.

Return value

None

Remarks

This function is a helper function used internally by the user-mode accessor functions. It provides mode-aware reading of structures from memory, with extra safety checks when accessing user-mode memory.

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

ReadStructFromMode

ReadStructFromModeAligned