Moves a block of memory from one location to another
#include <WinAPIMem.au3>
_WinAPI_MoveMemory ( $pDestination, $pSource, $iLength )
$pDestination | A pointer to the starting address of the move destination. |
$pSource | A pointer to the starting address of the block of memory to be moved. |
$iLength | The size of the block of memory to move, in bytes. |
Success: | 1. |
Failure: | 0 and sets the @error flag to non-zero. |
The source and destination blocks may overlap.
Search RtlMoveMemory in MSDN Library.
#include <WinAPIMem.au3>
Local $tStruct1 = DllStructCreate('int')
Local $tStruct2 = DllStructCreate('byte[4]')
DllStructSetData($tStruct1, 1, 0x11223344)
_WinAPI_MoveMemory($tStruct2, $tStruct1, 4)
ConsoleWrite('0x' & Hex(DllStructGetData($tStruct1, 1)) & @CRLF)
ConsoleWrite(DllStructGetData($tStruct2, 1) & @CRLF)