https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f82b00fa6c89b4730111…
commit 8f82b00fa6c89b47301115d61e0d8371ae4f0863
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Oct 14 16:28:13 2018 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Oct 14 16:28:13 2018 +0200
[MKHIVE] Minor code formatting.
---
sdk/tools/mkhive/binhive.c | 4 ++--
sdk/tools/mkhive/cmi.c | 5 +++++
sdk/tools/mkhive/cmi.h | 2 ++
sdk/tools/mkhive/mkhive.c | 3 +++
sdk/tools/mkhive/mkhive.h | 1 +
sdk/tools/mkhive/registry.c | 25 +++++++++++++++++++++++++
sdk/tools/mkhive/registry.h | 19 -------------------
7 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/sdk/tools/mkhive/binhive.c b/sdk/tools/mkhive/binhive.c
index 3d99346d9a..6615649924 100644
--- a/sdk/tools/mkhive/binhive.c
+++ b/sdk/tools/mkhive/binhive.c
@@ -26,10 +26,10 @@
/* INCLUDES *****************************************************************/
-#include <stdio.h>
-
#include "mkhive.h"
+/* FUNCTIONS ****************************************************************/
+
BOOL
ExportBinaryHive(
IN PCSTR FileName,
diff --git a/sdk/tools/mkhive/cmi.c b/sdk/tools/mkhive/cmi.c
index 6856cd1902..3798f54f9c 100644
--- a/sdk/tools/mkhive/cmi.c
+++ b/sdk/tools/mkhive/cmi.c
@@ -25,9 +25,13 @@
* Herm�s B�lusca-Ma�to
*/
+/* INCLUDES *****************************************************************/
+
#define NDEBUG
#include "mkhive.h"
+/* FUNCTIONS ****************************************************************/
+
PVOID
NTAPI
CmpAllocate(
@@ -422,6 +426,7 @@ CmiAddValueKey(
{
*pValueCell = NewValueCell;
*pValueCellOffset = NewValueCellOffset;
+ Status = STATUS_SUCCESS;
}
return Status;
diff --git a/sdk/tools/mkhive/cmi.h b/sdk/tools/mkhive/cmi.h
index 88611c2d4c..b34b098483 100644
--- a/sdk/tools/mkhive/cmi.h
+++ b/sdk/tools/mkhive/cmi.h
@@ -24,6 +24,8 @@
* PROGRAMMER: Herv� Poussineau
*/
+#pragma once
+
#define VERIFY_KEY_CELL(key)
NTSTATUS
diff --git a/sdk/tools/mkhive/mkhive.c b/sdk/tools/mkhive/mkhive.c
index 7458a5a71f..ab4342c9d9 100644
--- a/sdk/tools/mkhive/mkhive.c
+++ b/sdk/tools/mkhive/mkhive.c
@@ -26,6 +26,8 @@
* Hermès Bélusca-Maïto
*/
+/* INCLUDES *****************************************************************/
+
#include <limits.h>
#include <string.h>
#include <stdio.h>
@@ -48,6 +50,7 @@
#define DIR_SEPARATOR_STRING "\\"
#endif
+/* FUNCTIONS ****************************************************************/
void usage(void)
{
diff --git a/sdk/tools/mkhive/mkhive.h b/sdk/tools/mkhive/mkhive.h
index 82c8ecc2c3..2799020f0c 100644
--- a/sdk/tools/mkhive/mkhive.h
+++ b/sdk/tools/mkhive/mkhive.h
@@ -67,6 +67,7 @@ VOID NTAPI
RtlInitUnicodeString(
IN OUT PUNICODE_STRING DestinationString,
IN PCWSTR SourceString);
+
WCHAR NTAPI
RtlUpcaseUnicodeChar(
IN WCHAR Source);
diff --git a/sdk/tools/mkhive/registry.c b/sdk/tools/mkhive/registry.c
index 8fbc7d5b15..f82d4e5c5b 100644
--- a/sdk/tools/mkhive/registry.c
+++ b/sdk/tools/mkhive/registry.c
@@ -25,12 +25,35 @@
* Hermès Bélusca-Maïto
*/
+/* INCLUDES *****************************************************************/
+
#define NDEBUG
#include "mkhive.h"
+/* DEFINITIONS AND DATA *****************************************************/
+
#define STATUS_NO_LOG_SPACE ((NTSTATUS)0xC000017D)
#define STATUS_CANNOT_DELETE ((NTSTATUS)0xC0000121)
+typedef struct _REPARSE_POINT
+{
+ LIST_ENTRY ListEntry;
+ PCMHIVE SourceHive;
+ HCELL_INDEX SourceKeyCellOffset;
+ PCMHIVE DestinationHive;
+ HCELL_INDEX DestinationKeyCellOffset;
+} REPARSE_POINT, *PREPARSE_POINT;
+
+typedef struct _MEMKEY
+{
+ /* Information on hard disk structure */
+ HCELL_INDEX KeyCellOffset;
+ PCMHIVE RegistryHive;
+} MEMKEY, *PMEMKEY;
+
+#define HKEY_TO_MEMKEY(hKey) ((PMEMKEY)(hKey))
+#define MEMKEY_TO_HKEY(memKey) ((HKEY)(memKey))
+
static CMHIVE RootHive;
static PMEMKEY RootKey;
@@ -326,6 +349,7 @@ static UCHAR SystemSecurity[] =
0x01, 0x02, 0x00, 0x00
};
+/* GLOBALS ******************************************************************/
HIVE_LIST_ENTRY RegistryHives[/*MAX_NUMBER_OF_REGISTRY_HIVES*/] =
{
@@ -343,6 +367,7 @@ HIVE_LIST_ENTRY RegistryHives[/*MAX_NUMBER_OF_REGISTRY_HIVES*/] =
};
C_ASSERT(_countof(RegistryHives) == MAX_NUMBER_OF_REGISTRY_HIVES);
+/* FUNCTIONS ****************************************************************/
static PMEMKEY
CreateInMemoryStructure(
diff --git a/sdk/tools/mkhive/registry.h b/sdk/tools/mkhive/registry.h
index 7712de9d55..9c46af4e60 100644
--- a/sdk/tools/mkhive/registry.h
+++ b/sdk/tools/mkhive/registry.h
@@ -7,25 +7,6 @@
#pragma once
-typedef struct _REPARSE_POINT
-{
- LIST_ENTRY ListEntry;
- PCMHIVE SourceHive;
- HCELL_INDEX SourceKeyCellOffset;
- PCMHIVE DestinationHive;
- HCELL_INDEX DestinationKeyCellOffset;
-} REPARSE_POINT, *PREPARSE_POINT;
-
-typedef struct _MEMKEY
-{
- /* Information on hard disk structure */
- HCELL_INDEX KeyCellOffset;
- PCMHIVE RegistryHive;
-} MEMKEY, *PMEMKEY;
-
-#define HKEY_TO_MEMKEY(hKey) ((PMEMKEY)(hKey))
-#define MEMKEY_TO_HKEY(memKey) ((HKEY)(memKey))
-
typedef struct _HIVE_LIST_ENTRY
{
PCSTR HiveName;