Fills a block of memory with the given value.
#Include <WinAPIEx.au3>
_WinAPI_FillMemory ( $pMemory, $iLength [, $iValue] )
$pMemory | A pointer to the starting address of a memory to be filled. |
$iLength | The number of bytes to be filled. |
$iValue | [可选参数] The value to fill the memory. |
成功: | 返回 1. |
失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $tStruct = DllStructCreate('byte[8]')
ConsoleWrite(DllStructGetData($tStruct, 1) & @CR)
_WinAPI_FillMemory(DllStructGetPtr($tStruct), 8, 0xAB)
ConsoleWrite(DllStructGetData($tStruct, 1) & @CR)
_WinAPI_ZeroMemory(DllStructGetPtr($tStruct), 8)
ConsoleWrite(DllStructGetData($tStruct, 1) & @CR)