- Add Filip Navara's cmlib

- Use cmlib in Freeldr and Setupldr (patch by Filip Navara)
- Fix some HIVE definition and checksum calculation in mkhive and ntoskrnl (so they btoh create a compatible registry)

TODO: Apply 2nd half of the patch, which makes ntoskrnl using cmlib.

This commit is dedicated to Filip Navara's constant promises to commit cmlib and to recent small Arty vs. Alex debate on irc :)

svn path=/trunk/; revision=23332
This commit is contained in:
Aleksey Bragin 2006-07-28 20:25:47 +00:00
parent 02f0e4b7ac
commit b6fc604db0
10 changed files with 157 additions and 962 deletions

View file

@ -7,5 +7,6 @@
<library>freeldr_main</library>
<library>rossym</library>
<library>string</library>
<library>cmlib</library>
<library>rtl</library>
</module>

View file

@ -1,6 +1,7 @@
<module name="freeldr_base" type="objectlibrary">
<include base="freeldr_base">include</include>
<include base="freeldr_base">cache</include>
<include base="cmlib">.</include>
<include base="ntoskrnl">include</include>
<define name="__USE_W32API" />
<!--

View file

@ -43,7 +43,7 @@ typedef struct _CM_COMPONENT_INFORMATION
/* CM_COMPONENT_INFORMATION.Flags */
#define Failed 0x00000001
#define ReadOnly 0x00000002
//#define ReadOnly 0x00000002
#define Removable 0x00000004
#define ConsoleIn 0x00000008
#define ConsoleOut 0x00000010

File diff suppressed because it is too large Load diff

View file

@ -7,5 +7,6 @@
<library>setupldr_main</library>
<library>rossym</library>
<library>string</library>
<library>cmlib</library>
<library>rtl</library>
</module>

View file

@ -3,3 +3,4 @@ LIB_BASE_ = $(LIB_BASE)$(SEP)
include lib/inflib/inflib.mak
include lib/3rdparty/zlib/zlib.mak
include lib/cmlib/cmlib.mak

View file

@ -4,6 +4,9 @@
<directory name="3rdparty">
<xi:include href="3rdparty/3rdparty.rbuild" />
</directory>
<directory name="cmlib">
<xi:include href="cmlib/cmlib.rbuild" />
</directory>
<directory name="crt">
<xi:include href="crt/crt.rbuild" />
</directory>

View file

@ -94,7 +94,7 @@ typedef struct _HIVE_HEADER
ULONG Unused7;
/* Name of hive file */
WCHAR FileName[48];
WCHAR FileName[32];
ULONG Reserved[99];

View file

@ -1360,7 +1360,11 @@ CmiCalcChecksum(PULONG Buffer)
ULONG i;
for (i = 0; i < 127; i++)
Sum += Buffer[i];
Sum ^= Buffer[i];
if (Sum == (ULONG)-1)
Sum = (ULONG)-2;
if (Sum == 0)
Sum = 1;
return(Sum);
}

View file

@ -107,7 +107,7 @@ typedef struct _HIVE_HEADER
ULONG Unused7;
/* Name of hive file */
WCHAR FileName[48];
WCHAR FileName[32];
ULONG Reserved[99];
@ -1248,7 +1248,11 @@ CmiCalcHiveChecksum (PREGISTRY_HIVE Hive)
Buffer = (PULONG)Hive->HiveHeader;
Sum = 0;
for (i = 0; i < 127; i++)
Sum += Buffer[i];
Sum ^= Buffer[i];
if (Sum == (ULONG)-1)
Sum = (ULONG)-2;
if (Sum == 0)
Sum = 1;
Hive->HiveHeader->Checksum = Sum;
}