Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

hivesum.c

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1991 Microsoft Corporation 00004 00005 Module Name: 00006 00007 hivesum.c 00008 00009 Abstract: 00010 00011 Hive header checksum module. 00012 00013 Author: 00014 00015 Bryan M. Willman (bryanwi) 9-Apr-92 00016 00017 Environment: 00018 00019 00020 Revision History: 00021 00022 --*/ 00023 00024 #include "cmp.h" 00025 00026 #ifdef ALLOC_PRAGMA 00027 #pragma alloc_text(PAGE,HvpHeaderCheckSum) 00028 #endif 00029 00030 ULONG 00031 HvpHeaderCheckSum( 00032 PHBASE_BLOCK BaseBlock 00033 ) 00034 /*++ 00035 00036 Routine Description: 00037 00038 Compute the checksum for a hive disk header. 00039 00040 Arguments: 00041 00042 BaseBlock - supplies pointer to the header to checksum 00043 00044 Return Value: 00045 00046 the check sum. 00047 00048 --*/ 00049 { 00050 ULONG sum; 00051 ULONG i; 00052 00053 sum = 0; 00054 for (i = 0; i < 127; i++) { 00055 sum ^= ((PULONG)BaseBlock)[i]; 00056 } 00057 if (sum == (ULONG)-1) { 00058 sum = (ULONG)-2; 00059 } 00060 if (sum == 0) { 00061 sum = 1; 00062 } 00063 return sum; 00064 }

Generated on Sat May 15 19:40:17 2004 for test by doxygen 1.3.7