2006-11-08 11:47:44 +00:00
|
|
|
/*
|
2016-01-09 23:42:45 +00:00
|
|
|
* PROJECT: Registry manipulation library
|
2006-11-08 11:47:44 +00:00
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* COPYRIGHT: Copyright 2005 Filip Navara <navaraf@reactos.org>
|
|
|
|
* Copyright 2001 - 2005 Eric Kohl
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "cmlib.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name HvpHiveHeaderChecksum
|
|
|
|
*
|
|
|
|
* Compute checksum of hive header and return it.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ULONG CMAPI
|
|
|
|
HvpHiveHeaderChecksum(
|
2016-01-09 23:42:45 +00:00
|
|
|
PHBASE_BLOCK HiveHeader)
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
2016-01-09 23:42:45 +00:00
|
|
|
PULONG Buffer = (PULONG)HiveHeader;
|
|
|
|
ULONG Sum = 0;
|
|
|
|
ULONG i;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
2016-01-09 23:42:45 +00:00
|
|
|
for (i = 0; i < 127; i++)
|
|
|
|
Sum ^= Buffer[i];
|
|
|
|
if (Sum == (ULONG)-1)
|
|
|
|
Sum = (ULONG)-2;
|
|
|
|
if (Sum == 0)
|
|
|
|
Sum = 1;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
2016-01-09 23:42:45 +00:00
|
|
|
return Sum;
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|