- Fixed DPRINTs.

- Added support for including other .inf files while building the standard hives.

svn path=/trunk/; revision=9551
This commit is contained in:
Filip Navara 2004-05-29 21:15:58 +00:00
parent dd2e0b0978
commit 9136088529
3 changed files with 24 additions and 16 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: binhive.c,v 1.10 2004/05/09 14:50:09 ekohl Exp $
/* $Id: binhive.c,v 1.11 2004/05/29 21:15:58 navaraf Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS hive maker
* FILE: tools/mkhive/binhive.c
@ -351,7 +351,7 @@ CmiCreateRegistryHive (PCHAR KeyName)
}
memset (Hive, 0, sizeof(REGISTRY_HIVE));
DPRINT("Hive %x\n", Hive);
DPRINT("Hive %p\n", Hive);
/* Create hive beader (aka 'base block') */
Hive->HiveHeader = (PHIVE_HEADER) malloc (REG_BLOCK_SIZE);
@ -457,7 +457,7 @@ CmiDestroyRegistryHive (PREGISTRY_HIVE Hive)
Bin = Hive->BlockList[i];
DPRINT ("Bin[%lu]: Offset 0x%lx Size 0x%lx\n",
i, Bin->BlockOffset, Bin->BlockSize);
i, Bin->BinOffset, Bin->BinSize);
free (Bin);
}
@ -514,7 +514,7 @@ CmiMergeFree(PREGISTRY_HIVE RegistryHive,
PHBIN Bin;
ULONG i;
DPRINT("CmiMergeFree(Block %lx Offset %lx Size %lx) called\n",
DPRINT("CmiMergeFree(Block %p Offset %lx Size %lx) called\n",
FreeBlock, FreeOffset, FreeBlock->CellSize);
CmiGetCell (RegistryHive,
@ -608,7 +608,7 @@ CmiAddFree(PREGISTRY_HIVE RegistryHive,
assert(RegistryHive);
assert(FreeBlock);
DPRINT("FreeBlock %.08lx FreeOffset %.08lx\n",
DPRINT("FreeBlock %p FreeOffset %.08lx\n",
FreeBlock, FreeOffset);
/* Merge free blocks */
@ -1376,7 +1376,7 @@ CmiWriteHive(PREGISTRY_HIVE Hive,
Bin = Hive->BlockList[i];
DPRINT ("Bin[%lu]: Offset 0x%lx Size 0x%lx\n",
i, Bin->BlockOffset, Bin->BlockSize);
i, Bin->BinOffset, Bin->BinSize);
fwrite (Bin, Bin->BinSize, 1, File);
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: mkhive.c,v 1.3 2003/11/14 17:13:36 weiden Exp $
/* $Id: mkhive.c,v 1.4 2004/05/29 21:15:58 navaraf Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS hive maker
* FILE: tools/mkhive/mkhive.c
@ -47,9 +47,10 @@
void usage (void)
{
printf ("Usage: mkhive <srcdir> <dstdir>\n\n");
printf ("Usage: mkhive <srcdir> <dstdir> <addinf>\n\n");
printf (" srcdir - inf files are read from this directory\n");
printf (" dstdir - binary hive files are created in this directory\n");
printf (" addinf - additional inf files with full path\n");
}
void convert_path(char *dst, char *src)
@ -84,6 +85,7 @@ void convert_path(char *dst, char *src)
int main (int argc, char *argv[])
{
char FileName[PATH_MAX];
int Param;
printf ("Binary hive maker\n");
@ -115,6 +117,12 @@ int main (int argc, char *argv[])
strcat (FileName, "hivedef.inf");
ImportRegistryFile (FileName, "AddReg", FALSE);
for (Param = 3; Param < argc; Param++)
{
convert_path (FileName, argv[Param]);
ImportRegistryFile (FileName, "AddReg", FALSE);
}
convert_path (FileName, argv[2]);
strcat (FileName, DIR_SEPARATOR_STRING);
strcat (FileName, "system");

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: registry.c,v 1.8 2003/11/14 17:13:36 weiden Exp $
/* $Id: registry.c,v 1.9 2004/05/29 21:15:58 navaraf Exp $
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS hive maker
* FILE: tools/mkhive/registry.c
@ -171,12 +171,12 @@ RegCreateKey(HKEY ParentKey,
Ptr = CurrentKey->SubKeyList.Flink;
while (Ptr != &CurrentKey->SubKeyList)
{
DPRINT ("Ptr 0x%x\n", Ptr);
DPRINT ("Ptr 0x%p\n", Ptr);
SearchKey = CONTAINING_RECORD(Ptr,
KEY,
KeyList);
DPRINT ("SearchKey 0x%x\n", SearchKey);
DPRINT ("SearchKey 0x%p\n", SearchKey);
DPRINT ("Searching '%s'\n", SearchKey->Name);
if (strncasecmp (SearchKey->Name, name, subkeyLength) == 0)
break;
@ -211,8 +211,8 @@ RegCreateKey(HKEY ParentKey,
memcpy(NewKey->Name, name, subkeyLength);
NewKey->Name[subkeyLength] = 0;
DPRINT ("NewKey 0x%x\n", NewKey);
DPRINT ("NewKey '%s' Length %d\n", NewKey->Name, NewKey->NameSize);
DPRINT ("NewKey 0x%p\n", NewKey);
DPRINT ("NewKey '%s' Length %ld\n", NewKey->Name, NewKey->NameSize);
CurrentKey = NewKey;
}
@ -279,7 +279,7 @@ RegEnumKey(HKEY Key,
KEY,
KeyList);
DPRINT ("Name '%s' Length %d\n", SearchKey->Name, SearchKey->NameSize);
DPRINT ("Name '%s' Length %ld\n", SearchKey->Name, SearchKey->NameSize);
Size = min(SearchKey->NameSize, *NameSize);
*NameSize = Size;
@ -349,13 +349,13 @@ RegOpenKey(HKEY ParentKey,
Ptr = CurrentKey->SubKeyList.Flink;
while (Ptr != &CurrentKey->SubKeyList)
{
DPRINT ("Ptr 0x%x\n", Ptr);
DPRINT ("Ptr 0x%p\n", Ptr);
SearchKey = CONTAINING_RECORD(Ptr,
KEY,
KeyList);
DPRINT ("SearchKey 0x%x\n", SearchKey);
DPRINT ("SearchKey 0x%p\n", SearchKey);
DPRINT ("Searching '%s'\n", SearchKey->Name);
if (strncasecmp(SearchKey->Name, name, subkeyLength) == 0)