mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 21:38:43 +00:00
[RTL]
Fixed a really stupid (and old) bug in RtlComputeCrc32(): First parameter is initial CRC32 checksum. And it's complete and not partial, thus it needs to be an ULONG and not an USHORT. This fixes CRC32 checksum computation with initial checksum (tested again Windows 2003 & Seven). svn path=/trunk/; revision=48895
This commit is contained in:
parent
ced22a087c
commit
d695e74a70
2 changed files with 6 additions and 7 deletions
|
@ -3318,7 +3318,7 @@ NTSYSAPI
|
|||
ULONG
|
||||
NTAPI
|
||||
RtlComputeCrc32(
|
||||
IN USHORT PartialCrc,
|
||||
IN ULONG InitialCrc,
|
||||
IN PUCHAR Buffer,
|
||||
IN ULONG Length
|
||||
);
|
||||
|
|
|
@ -85,15 +85,14 @@ static const ULONG CrcTable[256] =
|
|||
* @implemented
|
||||
*/
|
||||
ULONG NTAPI
|
||||
RtlComputeCrc32 (IN USHORT Initial,
|
||||
IN PUCHAR Data,
|
||||
IN ULONG Length)
|
||||
RtlComputeCrc32(IN ULONG Initial,
|
||||
IN PUCHAR Data,
|
||||
IN ULONG Length)
|
||||
{
|
||||
ULONG CrcValue;
|
||||
ULONG CrcValue = ~Initial;
|
||||
|
||||
DPRINT("(%lu,%p,%lu)\n", Initial, Data, Length);
|
||||
DPRINT("(%d,%p,%d)\n", Initial, Data, Length);
|
||||
|
||||
CrcValue = ~Initial;
|
||||
while (Length > 0)
|
||||
{
|
||||
CrcValue = CrcTable[(CrcValue ^ *Data) & 0xff] ^ (CrcValue >> 8);
|
||||
|
|
Loading…
Reference in a new issue