MoveToUserFromUser - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// usermode_accessors.h

VOID MoveToUserFromUser(
  volatile VOID       *Destination,
  volatile const VOID *Source,
  SIZE_T              Length
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-usermode_accessors-movetouserfromuser)

Description

The MoveToUserFromUser function safely moves data from user-mode memory to user-mode memory, supporting overlapping memory regions.

Parameters

Destination

[out] A pointer to the starting address of the user-mode memory location where the data will be copied.

Source

[in] A pointer to the starting address of the user-mode memory location from which to copy the data.

Length

[in] The number of bytes to move.

Remarks

This function provides a safe way to move data from user-mode memory to user-mode memory with support for overlapping memory regions.

The function has the following properties:

The function validates that both pointers refer to user-mode memory and raises a structured exception if the move operation fails, such as when the source or destination addresses are not valid user-mode addresses or are 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.

See also

CopyToUserFromUser

CopyToUser

CopyFromUser