Compares two blocks of memory to determine whether the specified number of bytes are identical.
#Include <WinAPIEx.au3>
_WinAPI_EqualMemory ( $pSource1, $pSource2, $iLength )
$pSource1 | A pointer to the block of memory to compare. |
$pSource2 | A pointer to the block of memory that is compared to the block of memory to which $pSource1 points. |
$iLength | The number of bytes to be compared. |
Success | 1 - The two memory blocks are equivalent. |
0 | Otherwise. |
失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $tStruct1 = DllStructCreate('byte[8]')
Global $tStruct2 = DllStructCreate('byte[8]')
_WinAPI_FillMemory(DllStructGetPtr($tStruct1), 8, 0x1D)
_WinAPI_FillMemory(DllStructGetPtr($tStruct2), 8, 0x1D)
ConsoleWrite('Two structures are equivalent: ' & _WinAPI_EqualMemory(DllStructGetPtr($tStruct1), DllStructGetPtr($tStruct2), 8) & @CR)