Function Reference


_WinAPI_ComputeCrc32

Calculates the CRC32 checksum of a block of memory

#include <WinAPISys.au3>
_WinAPI_ComputeCrc32 ( $pMemory, $iLength )

Parameters

$pMemory A pointer to the memory block to calculate the checksum.
$iLength The number of bytes to be calculated.

Return Value

Success: The CRC32 checksum (DWORD).
Failure: 0 and sets the @error flag to non-zero.

Remarks

Not documented in MSDN

Example

#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)