Calculates the CRC32 checksum of a block of memory
#include <WinAPISys.au3>
_WinAPI_ComputeCrc32 ( $pMemory, $iLength )
$pMemory | A pointer to the memory block to calculate the checksum. |
$iLength | The number of bytes to be calculated. |
Success: | The CRC32 checksum (DWORD). |
Failure: | 0 and sets the @error flag to non-zero. |
Not documented in MSDN
#include <WinAPIMem.au3>
#include <WinAPISys.au3>
Local $tData = DllStructCreate('byte[4096]')
ConsoleWrite(Hex(_WinAPI_ComputeCrc32($tData, 4096)) & @CRLF)
_WinAPI_FillMemory($tData, 4096, Random(0, 255, 1))
ConsoleWrite(Hex(_WinAPI_ComputeCrc32($tData, 4096)) & @CRLF)
_WinAPI_ZeroMemory($tData, 4096)
ConsoleWrite(Hex(_WinAPI_ComputeCrc32($tData, 4096)) & @CRLF & @CRLF)
ConsoleWrite('Invalid pointer -> ' & _WinAPI_ComputeCrc32(0, 4) & ' @error = ' & @error & ' @extended = 0x' & Hex(@extended) & @CRLF)