函数参考


_WinAPI_MoveMemory

Moves a block of memory from one location to another.

#Include <WinAPIEx.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.

返回值

成功: 返回 1.
失败: 返回 0 并设置 @error 标志为非 0 值.

注意/说明

The source and destination blocks may overlap.

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $tStruct1 = DllStructCreate('dword')
Global $tStruct2 = DllStructCreate('byte[4]')

DllStructSetData($tStruct1, 1, 0x11223344)

_WinAPI_MoveMemory(DllStructGetPtr($tStruct2), DllStructGetPtr($tStruct1), 4)

ConsoleWrite('0x' & Hex(DllStructGetData($tStruct1, 1)) & @CR)
ConsoleWrite(DllStructGetData($tStruct2, 1) & @CR)