Author: fireball
Date: Mon Nov 24 07:01:56 2008
New Revision: 37613
URL:
http://svn.reactos.org/svn/reactos?rev=37613&view=rev
Log:
- Fix most of the warnings in mkhive.
Modified:
trunk/reactos/tools/mkhive/cmi.c
trunk/reactos/tools/mkhive/reginf.c
trunk/reactos/tools/mkhive/registry.c
Modified: trunk/reactos/tools/mkhive/cmi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/cmi.c?rev=376…
==============================================================================
--- trunk/reactos/tools/mkhive/cmi.c [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/cmi.c [iso-8859-1] Mon Nov 24 07:01:56 2008
@@ -622,7 +622,7 @@
NameLength = CmiGetPackedNameLength(ValueName, &Packable);
- DPRINT("ValueName->Length %lu NameLength %lu\n", ValueName->Length,
NameLength);
+ DPRINT("ValueName->Length %u NameLength %u\n", ValueName->Length,
NameLength);
*VBOffset = HvAllocateCell(&RegistryHive->Hive, sizeof(CM_KEY_VALUE) +
NameLength, Storage, HCELL_NIL);
if (*VBOffset == HCELL_NIL)
Modified: trunk/reactos/tools/mkhive/reginf.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/reginf.c?rev=…
==============================================================================
--- trunk/reactos/tools/mkhive/reginf.c [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/reginf.c [iso-8859-1] Mon Nov 24 07:01:56 2008
@@ -158,7 +158,7 @@
ValueName,
0,
REG_MULTI_SZ,
- (PCHAR)Buffer,
+ (PUCHAR)Buffer,
(ULONG)Total);
}
@@ -304,7 +304,7 @@
{
ULONG dw = Str ? strtoul (Str, NULL, 0) : 0;
- DPRINT("setting dword %s to %lx\n", ValueName, dw);
+ DPRINT("setting dword %s to %x\n", ValueName, dw);
RegSetValueExA (
KeyHandle,
@@ -343,7 +343,7 @@
}
else /* get the binary data */
{
- PCHAR Data = NULL;
+ PUCHAR Data = NULL;
if (InfHostGetBinaryField (Context, 5, NULL, 0, &Size) != 0)
Size = 0;
@@ -354,8 +354,8 @@
if (Data == NULL)
return FALSE;
- DPRINT("setting binary data %s len %lu\n", ValueName, Size);
- InfHostGetBinaryField (Context, 5, Data, (ULONG)Size, NULL);
+ DPRINT("setting binary data %s len %d\n", ValueName, Size);
+ InfHostGetBinaryField (Context, 5, Data, Size, NULL);
}
RegSetValueExA (
@@ -416,11 +416,11 @@
else
{
/* get flags */
- if (InfHostGetIntField (Context, 4, (PLONG)&Flags) != 0)
+ if (InfHostGetIntField (Context, 4, &Flags) != 0)
Flags = 0;
}
- DPRINT("Flags: %lx\n", Flags);
+ DPRINT("Flags: 0x%x\n", Flags);
if (Delete || (Flags & FLG_ADDREG_OVERWRITEONLY))
{
Modified: trunk/reactos/tools/mkhive/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/registry.c?re…
==============================================================================
--- trunk/reactos/tools/mkhive/registry.c [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/registry.c [iso-8859-1] Mon Nov 24 07:01:56 2008
@@ -384,7 +384,7 @@
if (cbData <= sizeof(HCELL_INDEX))
{
/* If data size <= sizeof(HCELL_INDEX) then store data in the data offset */
- DPRINT("ValueCell->DataLength %lu\n", ValueCell->DataLength);
+ DPRINT("ValueCell->DataLength %u\n", ValueCell->DataLength);
if (DataCell)
HvFreeCell(&Key->RegistryHive->Hive, ValueCell->Data);
@@ -401,12 +401,12 @@
* data block and allocate a new one. */
HCELL_INDEX NewOffset;
- DPRINT("ValueCell->DataLength %lu\n", ValueCell->DataLength);
+ DPRINT("ValueCell->DataLength %u\n", ValueCell->DataLength);
NewOffset = HvAllocateCell(&Key->RegistryHive->Hive, cbData, Stable,
HCELL_NIL);
if (NewOffset == HCELL_NIL)
{
- DPRINT("HvAllocateCell() failed with status 0x%08lx\n", Status);
+ DPRINT("HvAllocateCell() failed with status 0x%08x\n", Status);
return ERROR_UNSUCCESSFUL;
}
@@ -427,7 +427,7 @@
HvMarkCellDirty(&Key->RegistryHive->Hive, Key->KeyCellOffset, FALSE);
- DPRINT("Return status 0x%08lx\n", Status);
+ DPRINT("Return status 0x%08x\n", Status);
return Status;
}
@@ -581,7 +581,7 @@
Status = CmiInitializeTempHive(HiveToConnect);
if (!NT_SUCCESS(Status))
{
- DPRINT1("CmiInitializeTempHive() failed with status 0x%08lx\n", Status);
+ DPRINT1("CmiInitializeTempHive() failed with status 0x%08x\n", Status);
return FALSE;
}
@@ -599,29 +599,6 @@
return TRUE;
}
-static BOOL
-MyExportBinaryHive (PCHAR FileName,
- PCMHIVE RootHive)
-{
- FILE *File;
- BOOL ret;
-
- /* Create new hive file */
- File = fopen (FileName, "w+b");
- if (File == NULL)
- {
- printf(" Error creating/opening file\n");
- return FALSE;
- }
-
- fseek (File, 0, SEEK_SET);
-
- RootHive->FileHandles[HFILE_TYPE_PRIMARY] = (HANDLE)File;
- ret = HvWriteHive(&RootHive->Hive);
- fclose (File);
- return ret;
-}
-
LIST_ENTRY CmiHiveListHead;
VOID
@@ -636,7 +613,7 @@
Status = CmiInitializeTempHive(&RootHive);
if (!NT_SUCCESS(Status))
{
- DPRINT1("CmiInitializeTempHive() failed with status 0x%08lx\n", Status);
+ DPRINT1("CmiInitializeTempHive() failed with status 0x%08x\n", Status);
return;
}