Author: fireball
Date: Mon Oct 29 01:38:20 2007
New Revision: 29944
URL:
http://svn.reactos.org/svn/reactos?rev=29944&view=rev
Log:
- Include config/cm.h for cm based code, and remove all duplicated types and prototypes.
- Get rid of EREGISTRY_HIVE, and use CMHIVE instead. Although the current ReactOS code
doesn't make use of any of the functionality it offers, it's compatible with
EREGISTRY_HIVE (our version was a subset) and allows us to get rid of another ros-specifc
type, as well as being able to merge code from the cm-branch much more easily.
- Merge cmwraprs.c from the cm-branch, since the only differences were the filehandle
fields in EREGISTRY_HIVE vs CMHIVE.
- Enable the #if'ed out code in cminit.c since it now applies to CMHIVE.
Modified:
trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c
trunk/reactos/lib/cmlib/cmlib.h
trunk/reactos/ntoskrnl/cm/cm.h
trunk/reactos/ntoskrnl/cm/ntfunc.c
trunk/reactos/ntoskrnl/cm/regfile.c
trunk/reactos/ntoskrnl/cm/registry.c
trunk/reactos/ntoskrnl/cm/regobj.c
trunk/reactos/ntoskrnl/config/cm.h
trunk/reactos/ntoskrnl/config/cmapi.c
trunk/reactos/ntoskrnl/config/cminit.c
trunk/reactos/ntoskrnl/config/cmparse.c
trunk/reactos/ntoskrnl/config/cmsysini.c
trunk/reactos/ntoskrnl/config/cmwraprs.c
trunk/reactos/tools/mkhive/binhive.c
trunk/reactos/tools/mkhive/binhive.h
trunk/reactos/tools/mkhive/cmi.c
trunk/reactos/tools/mkhive/cmi.h
trunk/reactos/tools/mkhive/registry.c
trunk/reactos/tools/mkhive/registry.h
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/binhive.c Mon Oct 29 01:38:20 2007
@@ -710,13 +710,13 @@
FRLDRHKEY SystemKey;
ULONG i;
LONG Error;
- PEREGISTRY_HIVE CmHive;
+ PCMHIVE CmHive;
PHHIVE Hive;
NTSTATUS Status;
DbgPrint((DPRINT_REGISTRY, "RegImportBinaryHive(%x, %u)
called\n",ChunkBase,ChunkSize));
- CmHive = CmpAllocate(sizeof(EREGISTRY_HIVE), TRUE, 0);
+ CmHive = CmpAllocate(sizeof(CMHIVE), TRUE, 0);
Status = HvInitialize (&CmHive->Hive,
HINIT_FLAT,
0,
@@ -818,13 +818,13 @@
PCHAR ChunkBase,
ULONG* ChunkSize)
{
- PEREGISTRY_HIVE CmHive;
+ PCMHIVE CmHive;
PHHIVE Hive;
NTSTATUS Status;
DbgPrint((DPRINT_REGISTRY, "Creating binary hardware hive\n"));
- CmHive = CmpAllocate(sizeof(EREGISTRY_HIVE), TRUE, 0);
+ CmHive = CmpAllocate(sizeof(CMHIVE), TRUE, 0);
Status = HvInitialize (&CmHive->Hive,
HINIT_CREATE,
0,
Modified: trunk/reactos/lib/cmlib/cmlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=2994…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.h (original)
+++ trunk/reactos/lib/cmlib/cmlib.h Mon Oct 29 01:38:20 2007
@@ -27,6 +27,7 @@
#ifndef _TYPEDEFS_HOST_H
#include <ntddk.h>
+
#else
#define REG_OPTION_VOLATILE 1
#define OBJ_CASE_INSENSITIVE 0x00000040L
@@ -60,6 +61,14 @@
#define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP) / 32]) >> ((BP) %
32)) & 0x1)
+#define PKTHREAD PVOID
+#define PKGUARDED_MUTEX PVOID
+#define PERESOURCE PVOID
+#define PFILE_OBJECT PVOID
+#define PKEVENT PVOID
+#define PWORK_QUEUE_ITEM PVOID
+#define EX_PUSH_LOCK PULONG_PTR
+
#endif
#ifndef ROUND_UP
@@ -75,26 +84,87 @@
#include "hivedata.h"
#include "cmdata.h"
-#ifndef _CM_
-typedef struct _EREGISTRY_HIVE
+#if defined(_TYPEDEFS_HOST_H) || defined(__FREELDR_H)
+
+#define PCM_KEY_SECURITY_CACHE_ENTRY PVOID
+#define PCM_KEY_CONTROL_BLOCK PVOID
+#define CMP_SECURITY_HASH_LISTS 64
+#define PCM_CELL_REMAP_BLOCK PVOID
+
+//
+// Use Count Log and Entry
+//
+typedef struct _CM_USE_COUNT_LOG_ENTRY
{
- HHIVE Hive;
- LIST_ENTRY HiveList;
- UNICODE_STRING HiveFileName;
- UNICODE_STRING LogFileName;
- PCM_KEY_SECURITY RootSecurityCell;
- ULONG Flags;
- HANDLE HiveHandle;
- HANDLE LogHandle;
-} EREGISTRY_HIVE, *PEREGISTRY_HIVE;
-#endif
+ HCELL_INDEX Cell;
+ PVOID Stack[7];
+} CM_USE_COUNT_LOG_ENTRY, *PCM_USE_COUNT_LOG_ENTRY;
+
+typedef struct _CM_USE_COUNT_LOG
+{
+ USHORT Next;
+ USHORT Size;
+ CM_USE_COUNT_LOG_ENTRY Log[32];
+} CM_USE_COUNT_LOG, *PCM_USE_COUNT_LOG;
+
+//
+// Configuration Manager Hive Structure
+//
+typedef struct _CMHIVE
+{
+ HHIVE Hive;
+ HANDLE FileHandles[3];
+ LIST_ENTRY NotifyList;
+ LIST_ENTRY HiveList;
+ EX_PUSH_LOCK HiveLock;
+ PKTHREAD HiveLockOwner;
+ PKGUARDED_MUTEX ViewLock;
+ PKTHREAD ViewLockOwner;
+ EX_PUSH_LOCK WriterLock;
+ PKTHREAD WriterLockOwner;
+ PERESOURCE FlusherLock;
+ EX_PUSH_LOCK SecurityLock;
+ PKTHREAD HiveSecurityLockOwner;
+ LIST_ENTRY LRUViewListHead;
+ LIST_ENTRY PinViewListHead;
+ PFILE_OBJECT FileObject;
+ UNICODE_STRING FileFullPath;
+ UNICODE_STRING FileUserName;
+ USHORT MappedViews;
+ USHORT PinnedViews;
+ ULONG UseCount;
+ ULONG SecurityCount;
+ ULONG SecurityCacheSize;
+ LONG SecurityHitHint;
+ PCM_KEY_SECURITY_CACHE_ENTRY SecurityCache;
+ LIST_ENTRY SecurityHash[CMP_SECURITY_HASH_LISTS];
+ PKEVENT UnloadEvent;
+ PCM_KEY_CONTROL_BLOCK RootKcb;
+ BOOLEAN Frozen;
+ PWORK_QUEUE_ITEM UnloadWorkItem;
+ BOOLEAN GrowOnlyMode;
+ ULONG GrowOffset;
+ LIST_ENTRY KcbConvertListHead;
+ LIST_ENTRY KnodeConvertListHead;
+ PCM_CELL_REMAP_BLOCK CellRemapArray;
+ CM_USE_COUNT_LOG UseCountLog;
+ CM_USE_COUNT_LOG LockHiveLog;
+ ULONG Flags;
+ LIST_ENTRY TrustClassEntry;
+ ULONG FlushCount;
+ BOOLEAN HiveIsLoading;
+ PKTHREAD CreatorOwner;
+} CMHIVE, *PCMHIVE;
+
+#endif
+
/*
* Public functions.
*/
NTSTATUS CMAPI
HvInitialize(
- PHHIVE RegistryHive,
+ PHHIVE RegistryHive,
ULONG Operation,
ULONG HiveType,
ULONG HiveFlags,
Modified: trunk/reactos/ntoskrnl/cm/cm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/cm.h?rev=29944…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/cm.h (original)
+++ trunk/reactos/ntoskrnl/cm/cm.h Mon Oct 29 01:38:20 2007
@@ -1,7 +1,7 @@
#ifndef __INCLUDE_CM_H
#define __INCLUDE_CM_H
-#include <cmlib.h>
+#include "ntoskrnl/config/cm.h"
#ifdef DBG
#define CHECKED 1
@@ -48,116 +48,12 @@
#define IsNoFileHive(Hive) ((Hive)->Flags & HIVE_NO_FILE)
#define IsNoSynchHive(Hive) ((Hive)->Flags & HIVE_NO_SYNCH)
-//
-// Cached Child List
-//
-typedef struct _CACHED_CHILD_LIST
-{
- ULONG Count;
- union
- {
- ULONG ValueList;
- //struct _CM_KEY_CONTROL_BLOCK *RealKcb;
- struct _KEY_OBJECT *RealKcb;
- };
-} CACHED_CHILD_LIST, *PCACHED_CHILD_LIST;
/* KEY_OBJECT.Flags */
/* When set, the key is scheduled for deletion, and all
attempts to access the key must not succeed */
#define KO_MARKED_FOR_DELETE 0x00000001
-
-/* Type defining the Object Manager Key Object */
-typedef struct _KEY_OBJECT
-{
- /* Fields used by the Object Manager */
- CSHORT Type;
- CSHORT Size;
-
- /* Key flags */
- ULONG Flags;
-
- /* Key name */
- UNICODE_STRING Name;
-
- /* Registry hive the key belongs to */
- PEREGISTRY_HIVE RegistryHive;
-
- /* Block offset of the key cell this key belongs in */
- HCELL_INDEX KeyCellOffset;
-
- /* CM_KEY_NODE this key belong in */
- PCM_KEY_NODE KeyCell;
-
- /* Link to the parent KEY_OBJECT for this key */
- struct _KEY_OBJECT *ParentKey;
-
- /* List entry into the global key object list */
- LIST_ENTRY ListEntry;
-
- /* Subkeys loaded in SubKeys */
- ULONG SubKeyCounts;
-
- /* Space allocated in SubKeys */
- ULONG SizeOfSubKeys;
-
- /* List of subkeys loaded */
- struct _KEY_OBJECT **SubKeys;
-
- /* Time stamp for the last access by the parse routine */
- ULONG TimeStamp;
-
- /* List entry for connected hives */
- LIST_ENTRY HiveList;
-
- CACHED_CHILD_LIST ValueCache;
-} KEY_OBJECT, *PKEY_OBJECT;
-
-//
-// Key Control Block (KCB) for old Cm (just so it can talk to New CM)
-//
-typedef struct _CM_KEY_CONTROL_BLOCK
-{
- USHORT RefCount;
- USHORT Flags;
- ULONG ExtFlags:8;
- ULONG PrivateAlloc:1;
- ULONG Delete:1;
- ULONG DelayedCloseIndex:12;
- ULONG TotalLevels:10;
- union
- {
- //CM_KEY_HASH KeyHash;
- struct
- {
- ULONG ConvKey;
- PVOID NextHash;
- PHHIVE KeyHive;
- HCELL_INDEX KeyCell;
- };
- };
- struct _CM_KEY_CONTROL_BLOCK *ParentKcb;
- PVOID NameBlock;
- PVOID CachedSecurity;
- CACHED_CHILD_LIST ValueCache;
- PVOID IndexHint;
- ULONG HashKey;
- ULONG SubKeyCount;
- union
- {
- LIST_ENTRY KeyBodyListHead;
- LIST_ENTRY FreeListEntry;
- };
- PVOID KeyBodyArray[4];
- PVOID DelayCloseEntry;
- LARGE_INTEGER KcbLastWriteTime;
- USHORT KcbMaxNameLen;
- USHORT KcbMaxValueNameLen;
- ULONG KcbMaxValueDataLen;
- ULONG InDelayClose;
-} CM_KEY_CONTROL_BLOCK, *PCM_KEY_CONTROL_BLOCK;
-
/* Bits 31-22 (top 10 bits) of the cell index is the directory index */
#define CmiDirectoryIndex(CellIndex)(CellIndex & 0xffc000000)
@@ -167,11 +63,8 @@
#define CmiByteOffset(Cellndex)(CellIndex & 0x00000fff)
-extern PEREGISTRY_HIVE CmiVolatileHive;
extern POBJECT_TYPE CmpKeyObjectType;
extern KSPIN_LOCK CmiKeyListLock;
-
-extern LIST_ENTRY CmpHiveListHead;
extern ERESOURCE CmpRegistryLock;
extern EX_PUSH_LOCK CmpHiveListHeadLock;
@@ -224,24 +117,10 @@
ULONG Flags);
NTSTATUS
-CmiFlushRegistryHive(PEREGISTRY_HIVE RegistryHive);
-
-ULONG
-CmiGetMaxNameLength(IN PHHIVE RegistryHive, IN PCM_KEY_NODE KeyCell);
-
-ULONG
-CmiGetMaxClassLength(IN PHHIVE RegistryHive, IN PCM_KEY_NODE KeyCell);
-
-ULONG
-CmiGetMaxValueNameLength(IN PHHIVE RegistryHive,
- IN PCM_KEY_NODE KeyCell);
-
-ULONG
-CmiGetMaxValueDataLength(IN PHHIVE RegistryHive,
- IN PCM_KEY_NODE KeyCell);
+CmiFlushRegistryHive(PCMHIVE RegistryHive);
NTSTATUS
-CmiScanForSubKey(IN PEREGISTRY_HIVE RegistryHive,
+CmiScanForSubKey(IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
OUT PCM_KEY_NODE *SubKeyCell,
OUT HCELL_INDEX *BlockOffset,
@@ -250,110 +129,19 @@
IN ULONG Attributes);
NTSTATUS
-CmiAddSubKey(IN PEREGISTRY_HIVE RegistryHive,
- IN PKEY_OBJECT ParentKey,
- OUT PKEY_OBJECT SubKey,
- IN PUNICODE_STRING SubKeyName,
- IN ULONG TitleIndex,
- IN PUNICODE_STRING Class,
- IN ULONG CreateOptions);
-
-NTSTATUS
-CmiScanKeyForValue(IN PEREGISTRY_HIVE RegistryHive,
+CmiScanKeyForValue(IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN PUNICODE_STRING ValueName,
OUT PCM_KEY_VALUE *ValueCell,
OUT HCELL_INDEX *VBOffset);
-NTSTATUS
-NTAPI
-CmDeleteValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN UNICODE_STRING ValueName);
-
-NTSTATUS
-NTAPI
-CmQueryValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN UNICODE_STRING ValueName,
- IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
- IN PVOID KeyValueInformation,
- IN ULONG Length,
- IN PULONG ResultLength);
-
-NTSTATUS
-NTAPI
-CmEnumerateValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN ULONG Index,
- IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
- IN PVOID KeyValueInformation,
- IN ULONG Length,
- IN PULONG ResultLength);
-
-NTSTATUS
-NTAPI
-CmSetValueKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN PUNICODE_STRING ValueName,
- IN ULONG Type,
- IN PVOID Data,
- IN ULONG DataSize);
-
-NTSTATUS
-NTAPI
-CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN KEY_INFORMATION_CLASS KeyInformationClass,
- IN PVOID KeyInformation,
- IN ULONG Length,
- IN PULONG ResultLength);
-
-NTSTATUS
-NTAPI
-CmEnumerateKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
- IN ULONG Index,
- IN KEY_INFORMATION_CLASS KeyInformationClass,
- IN PVOID KeyInformation,
- IN ULONG Length,
- IN PULONG ResultLength);
-
-NTSTATUS
-NTAPI
-CmDeleteKey(IN PCM_KEY_CONTROL_BLOCK Kcb);
NTSTATUS
CmiConnectHive(POBJECT_ATTRIBUTES KeyObjectAttributes,
- PEREGISTRY_HIVE RegistryHive);
+ PCMHIVE RegistryHive);
NTSTATUS
CmiInitHives(BOOLEAN SetupBoot);
-
-NTSTATUS
-NTAPI
-CmpDoCreate(
- IN PHHIVE Hive,
- IN HCELL_INDEX Cell,
- IN PACCESS_STATE AccessState,
- IN PUNICODE_STRING Name,
- IN KPROCESSOR_MODE AccessMode,
- IN PUNICODE_STRING Class,
- IN ULONG CreateOptions,
- IN PKEY_OBJECT Parent,
- IN PVOID OriginatingHive OPTIONAL,
- OUT PVOID *Object
-);
-
-HCELL_INDEX
-NTAPI
-CmpFindValueByName(
- IN PHHIVE Hive,
- IN PCM_KEY_NODE KeyNode,
- IN PUNICODE_STRING Name
-);
-
-HCELL_INDEX
-NTAPI
-CmpFindSubKeyByName(
- IN PHHIVE Hive,
- IN PCM_KEY_NODE Parent,
- IN PCUNICODE_STRING SearchName
-);
VOID
CmiSyncHives(VOID);
@@ -370,49 +158,8 @@
IN PVOID ParseContext
);
-NTSTATUS
-NTAPI
-CmpOpenHiveFiles(IN PCUNICODE_STRING BaseName,
- IN PCWSTR Extension OPTIONAL,
- IN PHANDLE Primary,
- IN PHANDLE Log,
- IN PULONG PrimaryDisposition,
- IN PULONG LogDisposition,
- IN BOOLEAN CreateAllowed,
- IN BOOLEAN MarkAsSystemHive,
- IN BOOLEAN NoBuffering,
- OUT PULONG ClusterSize OPTIONAL);
-
-NTSTATUS
-NTAPI
-CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName,
- IN ULONG HiveFlags,
- OUT PEREGISTRY_HIVE *Hive,
- IN OUT PBOOLEAN New,
- IN ULONG CheckFlags);
-
// Some Ob definitions for debug messages in Cm
#define ObGetObjectPointerCount(x) OBJECT_TO_OBJECT_HEADER(x)->PointerCount
#define ObGetObjectHandleCount(x) OBJECT_TO_OBJECT_HEADER(x)->HandleCount
-//
-// System Control Vector
-//
-typedef struct _CM_SYSTEM_CONTROL_VECTOR
-{
- PWCHAR KeyPath;
- PWCHAR ValueName;
- PVOID Buffer;
- PULONG BufferLength;
- PULONG Type;
-} CM_SYSTEM_CONTROL_VECTOR, *PCM_SYSTEM_CONTROL_VECTOR;
-
-VOID
-NTAPI
-CmGetSystemControlValues(
- IN PVOID SystemHiveData,
- IN PCM_SYSTEM_CONTROL_VECTOR ControlVector
-);
-
-extern CM_SYSTEM_CONTROL_VECTOR CmControlVector[];
#endif /*__INCLUDE_CM_H*/
Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/ntfunc.c (original)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c Mon Oct 29 01:38:20 2007
@@ -412,7 +412,7 @@
{
NTSTATUS Status;
PKEY_OBJECT KeyObject;
- PEREGISTRY_HIVE RegistryHive;
+ PCMHIVE RegistryHive;
KPROCESSOR_MODE PreviousMode;
PAGED_CODE();
Modified: trunk/reactos/ntoskrnl/cm/regfile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regfile.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/regfile.c (original)
+++ trunk/reactos/ntoskrnl/cm/regfile.c Mon Oct 29 01:38:20 2007
@@ -12,9 +12,7 @@
#include <ntoskrnl.h>
#define NDEBUG
#include <internal/debug.h>
-
#include "cm.h"
-#include "../config/cm.h"
/* LOCAL MACROS *************************************************************/
@@ -29,7 +27,7 @@
IN PCUNICODE_STRING FileName,
IN ULONG Flags)
{
- PEREGISTRY_HIVE Hive = NULL;
+ PCMHIVE Hive = NULL;
NTSTATUS Status;
BOOLEAN Allocate = TRUE;
@@ -61,14 +59,14 @@
}
VOID
-CmCloseHiveFiles(PEREGISTRY_HIVE RegistryHive)
-{
- ZwClose(RegistryHive->HiveHandle);
- ZwClose(RegistryHive->LogHandle);
+CmCloseHiveFiles(PCMHIVE RegistryHive)
+{
+ ZwClose(RegistryHive->FileHandles[HFILE_TYPE_PRIMARY]);
+ ZwClose(RegistryHive->FileHandles[HFILE_TYPE_LOG]);
}
NTSTATUS
-CmiFlushRegistryHive(PEREGISTRY_HIVE RegistryHive)
+CmiFlushRegistryHive(PCMHIVE RegistryHive)
{
BOOLEAN Success;
NTSTATUS Status;
@@ -81,10 +79,10 @@
return(STATUS_SUCCESS);
}
- Status = CmpOpenHiveFiles(&RegistryHive->HiveFileName,
+ Status = CmpOpenHiveFiles(&RegistryHive->FileFullPath,
L".LOG",
- &RegistryHive->HiveHandle,
- &RegistryHive->LogHandle,
+ &RegistryHive->FileHandles[HFILE_TYPE_PRIMARY],
+ &RegistryHive->FileHandles[HFILE_TYPE_LOG],
&Disposition,
&Disposition,
FALSE,
@@ -255,7 +253,7 @@
}
NTSTATUS
-CmiScanKeyForValue(IN PEREGISTRY_HIVE RegistryHive,
+CmiScanKeyForValue(IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN PUNICODE_STRING ValueName,
OUT PCM_KEY_VALUE *ValueCell,
@@ -278,7 +276,7 @@
}
NTSTATUS
-CmiScanForSubKey(IN PEREGISTRY_HIVE RegistryHive,
+CmiScanForSubKey(IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
OUT PCM_KEY_NODE *SubKeyCell,
OUT HCELL_INDEX *BlockOffset,
Modified: trunk/reactos/ntoskrnl/cm/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/registry.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/registry.c (original)
+++ trunk/reactos/ntoskrnl/cm/registry.c Mon Oct 29 01:38:20 2007
@@ -18,7 +18,6 @@
#include <internal/debug.h>
#include "cm.h"
-#include "../config/cm.h"
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, CmInitSystem1)
@@ -29,7 +28,7 @@
extern BOOLEAN ExpInTextModeSetup;
POBJECT_TYPE CmpKeyObjectType = NULL;
-PEREGISTRY_HIVE CmiVolatileHive = NULL;
+PCMHIVE CmiVolatileHive = NULL;
LIST_ENTRY CmpHiveListHead;
@@ -245,7 +244,7 @@
NTAPI
CmpLinkHiveToMaster(IN PUNICODE_STRING LinkName,
IN HANDLE RootDirectory,
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN BOOLEAN Allocate,
IN PSECURITY_DESCRIPTOR SecurityDescriptor)
{
@@ -267,7 +266,7 @@
NTSTATUS
CmiConnectHive(IN POBJECT_ATTRIBUTES KeyObjectAttributes,
- IN PEREGISTRY_HIVE RegistryHive)
+ IN PCMHIVE RegistryHive)
{
UNICODE_STRING RemainingPath;
PKEY_OBJECT ParentKey;
@@ -671,7 +670,7 @@
VOID
CmShutdownRegistry(VOID)
{
- PEREGISTRY_HIVE Hive;
+ PCMHIVE Hive;
PLIST_ENTRY Entry;
DPRINT("CmShutdownRegistry() called\n");
@@ -692,7 +691,7 @@
Entry = CmpHiveListHead.Flink;
while (Entry != &CmpHiveListHead)
{
- Hive = CONTAINING_RECORD(Entry, EREGISTRY_HIVE, HiveList);
+ Hive = CONTAINING_RECORD(Entry, CMHIVE, HiveList);
if (!(IsNoFileHive(Hive) || IsNoSynchHive(Hive)))
{
@@ -713,7 +712,7 @@
NTAPI
CmiHiveSyncRoutine(PVOID DeferredContext)
{
- PEREGISTRY_HIVE Hive;
+ PCMHIVE Hive;
PLIST_ENTRY Entry;
DPRINT("CmiHiveSyncRoutine() called\n");
@@ -726,7 +725,7 @@
Entry = CmpHiveListHead.Flink;
while (Entry != &CmpHiveListHead)
{
- Hive = CONTAINING_RECORD(Entry, EREGISTRY_HIVE, HiveList);
+ Hive = CONTAINING_RECORD(Entry, CMHIVE, HiveList);
if (!(IsNoFileHive(Hive) || IsNoSynchHive(Hive)))
{
Modified: trunk/reactos/ntoskrnl/cm/regobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regobj.c?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/regobj.c (original)
+++ trunk/reactos/ntoskrnl/cm/regobj.c Mon Oct 29 01:38:20 2007
@@ -21,7 +21,7 @@
extern ULONG CmiTimer;
static NTSTATUS
-CmiGetLinkTarget(PEREGISTRY_HIVE RegistryHive,
+CmiGetLinkTarget(PCMHIVE RegistryHive,
PCM_KEY_NODE KeyCell,
PUNICODE_STRING TargetPath);
@@ -809,7 +809,7 @@
}
static NTSTATUS
-CmiGetLinkTarget(PEREGISTRY_HIVE RegistryHive,
+CmiGetLinkTarget(PCMHIVE RegistryHive,
PCM_KEY_NODE KeyCell,
PUNICODE_STRING TargetPath)
{
Modified: trunk/reactos/ntoskrnl/config/cm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cm.h?rev=2…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cm.h (original)
+++ trunk/reactos/ntoskrnl/config/cm.h Mon Oct 29 01:38:20 2007
@@ -92,8 +92,6 @@
PAGE_SIZE / sizeof(CM_KEY_CONTROL_BLOCK)
#define CM_DELAYS_PER_PAGE \
PAGE_SIZE / sizeof(CM_DELAYED_CLOSE_ENTRY)
-
-#ifndef __INCLUDE_CM_H
//
// Value Search Results
@@ -496,24 +494,13 @@
#define REG_SYSTEM_KEY_NAME L"\\Registry\\Machine\\SYSTEM"
#define REG_HARDWARE_KEY_NAME L"\\Registry\\Machine\\HARDWARE"
#define IsNoFileHive(Hive) ((Hive)->Flags & HIVE_NO_FILE)
-typedef struct _EREGISTRY_HIVE
-{
- HHIVE Hive;
- LIST_ENTRY HiveList;
- UNICODE_STRING HiveFileName;
- UNICODE_STRING LogFileName;
- PCM_KEY_SECURITY RootSecurityCell;
- ULONG Flags;
- HANDLE HiveHandle;
- HANDLE LogHandle;
-} EREGISTRY_HIVE, *PEREGISTRY_HIVE;
typedef struct _KEY_OBJECT
{
CSHORT Type;
CSHORT Size;
ULONG Flags;
UNICODE_STRING Name;
- PEREGISTRY_HIVE RegistryHive;
+ PCMHIVE RegistryHive;
HCELL_INDEX KeyCellOffset;
PCM_KEY_NODE KeyCell;
struct _KEY_OBJECT *ParentKey;
@@ -525,7 +512,7 @@
LIST_ENTRY HiveList;
CACHED_CHILD_LIST ValueCache;
} KEY_OBJECT, *PKEY_OBJECT;
-extern PEREGISTRY_HIVE CmiVolatileHive;
+extern PCMHIVE CmiVolatileHive;
extern LIST_ENTRY CmiKeyObjectListHead, CmiConnectedHiveList;
extern KTIMER CmiWorkerTimer;
VOID NTAPI CmiWorkerThread(IN PVOID Param);
@@ -755,8 +742,6 @@
IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
-/* NOTE: This function declaration is currently duplicated in both */
-/* cm/cm.h and config/cm.h. TODO: Pick one single place to declare it. */
NTSTATUS
NTAPI
CmpOpenHiveFiles(
@@ -772,6 +757,16 @@
OUT PULONG ClusterSize OPTIONAL
);
+NTSTATUS
+NTAPI
+CmpInitHiveFromFile(
+ IN PCUNICODE_STRING HiveName,
+ IN ULONG HiveFlags,
+ OUT PCMHIVE *Hive,
+ IN OUT PBOOLEAN New,
+ IN ULONG CheckFlags
+);
+
//
// Registry Utility Functions
//
@@ -832,7 +827,7 @@
#if 0
IN PCM_KEY_BODY KeyObject,
#else
- IN PVOID KeyObject,
+ IN PKEY_OBJECT KeyObject,
#endif
IN ULONG Flags
);
@@ -918,11 +913,27 @@
);
//
+// Open/Create Routines
+//
+NTSTATUS
+NTAPI
+CmpDoCreate(
+ IN PHHIVE Hive,
+ IN HCELL_INDEX Cell,
+ IN PACCESS_STATE AccessState,
+ IN PUNICODE_STRING Name,
+ IN KPROCESSOR_MODE AccessMode,
+ IN PUNICODE_STRING Class,
+ IN ULONG CreateOptions,
+ IN PKEY_OBJECT Parent,
+ IN PCMHIVE OriginatingHive OPTIONAL,
+ OUT PVOID *Object
+);
+
+//
// Cell Index Routines
//
-/* NOTE: This function declaration is currently duplicated in both */
-/* cm/cm.h and config/cm.h. TODO: Pick one single place to declare it. */
HCELL_INDEX
NTAPI
CmpFindSubKeyByName(
@@ -1063,6 +1074,14 @@
IN PUNICODE_STRING SelectKeyName,
OUT PBOOLEAN AutoSelect
);
+
+VOID
+NTAPI
+CmGetSystemControlValues(
+ IN PVOID SystemHiveData,
+ IN PCM_SYSTEM_CONTROL_VECTOR ControlVector
+);
+
//
// Hardware Configuration Routines
@@ -1152,6 +1171,71 @@
IN ULONG FileType,
IN OUT PLARGE_INTEGER FileOffset,
IN ULONG Length
+);
+
+//
+// Configuration Manager side of Registry System Calls
+//
+NTSTATUS
+NTAPI
+CmEnumerateValueKey(
+ IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN ULONG Index,
+ IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
+ IN PVOID KeyValueInformation,
+ IN ULONG Length,
+ IN PULONG ResultLength);
+
+NTSTATUS
+NTAPI
+CmSetValueKey(
+ IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN PUNICODE_STRING ValueName,
+ IN ULONG Type,
+ IN PVOID Data,
+ IN ULONG DataSize);
+
+NTSTATUS
+NTAPI
+CmQueryKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN KEY_INFORMATION_CLASS KeyInformationClass,
+ IN PVOID KeyInformation,
+ IN ULONG Length,
+ IN PULONG ResultLength
+);
+
+NTSTATUS
+NTAPI
+CmEnumerateKey(IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN ULONG Index,
+ IN KEY_INFORMATION_CLASS KeyInformationClass,
+ IN PVOID KeyInformation,
+ IN ULONG Length,
+ IN PULONG ResultLength
+);
+
+NTSTATUS
+NTAPI
+CmDeleteKey(
+ IN PCM_KEY_CONTROL_BLOCK Kcb
+);
+
+NTSTATUS
+NTAPI
+CmDeleteValueKey(
+ IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN UNICODE_STRING ValueName
+);
+
+NTSTATUS
+NTAPI
+CmQueryValueKey(
+ IN PCM_KEY_CONTROL_BLOCK Kcb,
+ IN UNICODE_STRING ValueName,
+ IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
+ IN PVOID KeyValueInformation,
+ IN ULONG Length,
+ IN PULONG ResultLength
);
//
@@ -1197,5 +1281,3 @@
// Inlined functions
//
#include "cm_x.h"
-
-#endif
Modified: trunk/reactos/ntoskrnl/config/cmapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmapi.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmapi.c (original)
+++ trunk/reactos/ntoskrnl/config/cmapi.c Mon Oct 29 01:38:20 2007
@@ -1052,8 +1052,8 @@
}
/* Make sure we're file-backed */
- if (!(IsNoFileHive((PEREGISTRY_HIVE)Kcb->KeyHive)) ||
- !(IsNoFileHive((PEREGISTRY_HIVE)Kcb->ParentKcb->KeyHive)))
+ if (!(IsNoFileHive((PCMHIVE)Kcb->KeyHive)) ||
+ !(IsNoFileHive((PCMHIVE)Kcb->ParentKcb->KeyHive)))
{
/* Sync up the hives */
CmiSyncHives();
Modified: trunk/reactos/ntoskrnl/config/cminit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cminit.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cminit.c (original)
+++ trunk/reactos/ntoskrnl/config/cminit.c Mon Oct 29 01:38:20 2007
@@ -28,12 +28,8 @@
IN PCUNICODE_STRING FileName OPTIONAL,
IN ULONG CheckFlags)
{
-#if 0
PCMHIVE Hive;
-#else
- PEREGISTRY_HIVE Hive;
FILE_STANDARD_INFORMATION FileInformation;
-#endif
IO_STATUS_BLOCK IoStatusBlock;
FILE_FS_SIZE_INFORMATION FileSizeInformation;
NTSTATUS Status;
@@ -89,9 +85,9 @@
}
/* Allocate the hive */
- Hive = ExAllocatePoolWithTag(NonPagedPool, sizeof(EREGISTRY_HIVE), TAG_CM);
+ Hive = ExAllocatePoolWithTag(NonPagedPool, sizeof(CMHIVE), TAG_CM);
if (!Hive) return STATUS_INSUFFICIENT_RESOURCES;
-#if 0
+
/* Setup null fields */
Hive->UnloadEvent = NULL;
Hive->RootKcb = NULL;
@@ -142,11 +138,11 @@
ExInitializeResourceLite(Hive->FlusherLock);
/* Setup hive locks */
- ExInitializePushLock(&Hive->HiveLock);
+ ExInitializePushLock((PULONG_PTR)&Hive->HiveLock);
Hive->HiveLockOwner = NULL;
- ExInitializePushLock(&Hive->WriterLock);
+ ExInitializePushLock((PULONG_PTR)&Hive->WriterLock);
Hive->WriterLockOwner = NULL;
- ExInitializePushLock(&Hive->SecurityLock);
+ ExInitializePushLock((PULONG_PTR)&Hive->SecurityLock);
Hive->HiveSecurityLockOwner = NULL;
/* Clear file names */
@@ -154,22 +150,17 @@
RtlInitEmptyUnicodeString(&Hive->FileFullPath, NULL, 0);
/* Initialize the view list */
- CmpInitializeHiveViewList(Hive);
+ CmpInitHiveViewList(Hive);
/* Initailize the security cache */
- CmpInitializeSecurityCache(Hive);
+ CmpInitSecurityCache(Hive);
/* Setup flags */
Hive->Flags = 0;
Hive->FlushCount = 0;
-#else
- /* Clear it */
- RtlZeroMemory(Hive, sizeof(EREGISTRY_HIVE));
/* Set flags */
Hive->Flags = HiveFlags;
- Hive->HiveHandle = Primary;
- Hive->LogHandle = Log;
/* Check how large the file is */
ZwQueryInformationFile(Primary,
@@ -178,7 +169,6 @@
sizeof(FileInformation),
FileStandardInformation);
Cluster = FileInformation.EndOfFile.LowPart;
-#endif
/* Initialize it */
Status = HvInitialize(&Hive->Hive,
@@ -197,10 +187,8 @@
if (!NT_SUCCESS(Status))
{
/* Clear allocations and fail */
-#if 0
ExFreePool(Hive->ViewLock);
ExFreePool(Hive->FlusherLock);
-#endif
ExFreePool(Hive);
return Status;
}
@@ -215,10 +203,8 @@
if (CmCheckRegistry((PCMHIVE)Hive, TRUE))
{
/* Free all alocations */
-#if 0
ExFreePool(Hive->ViewLock);
ExFreePool(Hive->FlusherLock);
-#endif
ExFreePool(Hive);
return STATUS_REGISTRY_CORRUPT;
}
Modified: trunk/reactos/ntoskrnl/config/cmparse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmparse.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmparse.c (original)
+++ trunk/reactos/ntoskrnl/config/cmparse.c Mon Oct 29 01:38:20 2007
@@ -267,7 +267,7 @@
if (!Class) Class = &LocalClass;
/* Acquire the flusher lock */
- //ExAcquirePushLockShared((PVOID)&((PCMHIVE)Hive)->FlusherLock);
+ ExAcquirePushLockShared((PVOID)&((PCMHIVE)Hive)->FlusherLock);
/* Check if the parent is being deleted */
#define KO_MARKED_FOR_DELETE 0x00000001
@@ -397,6 +397,6 @@
Exit:
/* Release the flusher lock and return status */
- //ExReleasePushLock((PVOID)&((PCMHIVE)Hive)->FlusherLock);
+ ExReleasePushLock((PVOID)&((PCMHIVE)Hive)->FlusherLock);
return Status;
}
Modified: trunk/reactos/ntoskrnl/config/cmsysini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmsysini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmsysini.c (original)
+++ trunk/reactos/ntoskrnl/config/cmsysini.c Mon Oct 29 01:38:20 2007
@@ -32,7 +32,7 @@
HANDLE FileHandle = NULL, LogHandle = NULL;
NTSTATUS Status;
ULONG Operation, FileType;
- PEREGISTRY_HIVE NewHive;
+ PCMHIVE NewHive;
PAGED_CODE();
/* Assume failure */
@@ -110,24 +110,24 @@
}
/* Success, return hive */
- *Hive = (PCMHIVE)NewHive;
+ *Hive = NewHive;
/* ROS: Init root key cell and prepare the hive */
if (Operation == HINIT_CREATE) CmCreateRootNode(&NewHive->Hive,
L"");
CmPrepareHive(&NewHive->Hive);
/* Duplicate the hive name */
- NewHive->HiveFileName.Buffer = ExAllocatePoolWithTag(PagedPool,
+ NewHive->FileFullPath.Buffer = ExAllocatePoolWithTag(PagedPool,
HiveName->Length,
TAG_CM);
- if (NewHive->HiveFileName.Buffer)
+ if (NewHive->FileFullPath.Buffer)
{
/* Copy the string */
- RtlCopyMemory(NewHive->HiveFileName.Buffer,
+ RtlCopyMemory(NewHive->FileFullPath.Buffer,
HiveName->Buffer,
HiveName->Length);
- NewHive->HiveFileName.Length = HiveName->Length;
- NewHive->HiveFileName.MaximumLength = HiveName->MaximumLength;
+ NewHive->FileFullPath.Length = HiveName->Length;
+ NewHive->FileFullPath.MaximumLength = HiveName->MaximumLength;
}
/* ROS: Close the hive files */
@@ -434,7 +434,7 @@
NTSTATUS Status;
BOOLEAN Allocate;
UNICODE_STRING KeyName;
- PEREGISTRY_HIVE SystemHive = NULL;
+ PCMHIVE SystemHive = NULL;
UNICODE_STRING HiveName = RTL_CONSTANT_STRING(L"SYSTEM");
PSECURITY_DESCRIPTOR SecurityDescriptor;
PAGED_CODE();
@@ -479,7 +479,7 @@
CmPrepareHive(&SystemHive->Hive);
/* Set the hive filename */
- RtlCreateUnicodeString(&SystemHive->HiveFileName, SYSTEM_REG_FILE);
+ RtlCreateUnicodeString(&SystemHive->FileFullPath, SYSTEM_REG_FILE);
/* We imported, no need to create a new hive */
Allocate = FALSE;
@@ -756,7 +756,7 @@
LARGE_INTEGER DueTime;
HANDLE ThreadHandle;
CLIENT_ID ThreadId;
- PEREGISTRY_HIVE HardwareHive;
+ PCMHIVE HardwareHive;
PVOID BaseAddress;
ULONG Length;
PSECURITY_DESCRIPTOR SecurityDescriptor;
Modified: trunk/reactos/ntoskrnl/config/cmwraprs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmwraprs.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmwraprs.c (original)
+++ trunk/reactos/ntoskrnl/config/cmwraprs.c Mon Oct 29 01:38:20 2007
@@ -77,8 +77,8 @@
OUT PVOID Buffer,
IN SIZE_T BufferLength)
{
- PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive;
- HANDLE HiveHandle = FileType == HFILE_TYPE_PRIMARY ? CmHive->HiveHandle :
CmHive->LogHandle;
+ PCMHIVE CmHive = (PCMHIVE)RegistryHive;
+ HANDLE HiveHandle = CmHive->FileHandles[FileType];
LARGE_INTEGER _FileOffset;
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
@@ -97,8 +97,8 @@
IN PVOID Buffer,
IN SIZE_T BufferLength)
{
- PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive;
- HANDLE HiveHandle = FileType == HFILE_TYPE_PRIMARY ? CmHive->HiveHandle :
CmHive->LogHandle;
+ PCMHIVE CmHive = (PCMHIVE)RegistryHive;
+ HANDLE HiveHandle = CmHive->FileHandles[FileType];
LARGE_INTEGER _FileOffset;
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
@@ -116,8 +116,8 @@
IN ULONG FileSize,
IN ULONG OldFileSize)
{
- PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive;
- HANDLE HiveHandle = FileType == HFILE_TYPE_PRIMARY ? CmHive->HiveHandle :
CmHive->LogHandle;
+ PCMHIVE CmHive = (PCMHIVE)RegistryHive;
+ HANDLE HiveHandle = CmHive->FileHandles[FileType];
FILE_END_OF_FILE_INFORMATION EndOfFileInfo;
FILE_ALLOCATION_INFORMATION FileAllocationInfo;
IO_STATUS_BLOCK IoStatusBlock;
@@ -149,8 +149,8 @@
IN OUT PLARGE_INTEGER FileOffset,
IN ULONG Length)
{
- PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive;
- HANDLE HiveHandle = FileType == HFILE_TYPE_PRIMARY ? CmHive->HiveHandle :
CmHive->LogHandle;
+ PCMHIVE CmHive = (PCMHIVE)RegistryHive;
+ HANDLE HiveHandle = CmHive->FileHandles[FileType];
IO_STATUS_BLOCK IoStatusBlock;
NTSTATUS Status;
Modified: trunk/reactos/tools/mkhive/binhive.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/binhive.c?rev…
==============================================================================
--- trunk/reactos/tools/mkhive/binhive.c (original)
+++ trunk/reactos/tools/mkhive/binhive.c Mon Oct 29 01:38:20 2007
@@ -32,7 +32,7 @@
BOOL
ExportBinaryHive(
IN PCSTR FileName,
- IN PEREGISTRY_HIVE Hive)
+ IN PCMHIVE Hive)
{
FILE *File;
BOOL ret;
@@ -49,7 +49,7 @@
fseek (File, 0, SEEK_SET);
- Hive->HiveHandle = (HANDLE)File;
+ Hive->FileHandles[HFILE_TYPE_PRIMARY] = (HANDLE)File;
ret = HvWriteHive(&Hive->Hive);
fclose (File);
return ret;
Modified: trunk/reactos/tools/mkhive/binhive.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/binhive.h?rev…
==============================================================================
--- trunk/reactos/tools/mkhive/binhive.h (original)
+++ trunk/reactos/tools/mkhive/binhive.h Mon Oct 29 01:38:20 2007
@@ -29,7 +29,7 @@
BOOL
ExportBinaryHive(
IN PCSTR FileName,
- IN PEREGISTRY_HIVE Hive);
+ IN PCMHIVE Hive);
#endif /* __BINHIVE_H__ */
Modified: trunk/reactos/tools/mkhive/cmi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/cmi.c?rev=299…
==============================================================================
--- trunk/reactos/tools/mkhive/cmi.c (original)
+++ trunk/reactos/tools/mkhive/cmi.c Mon Oct 29 01:38:20 2007
@@ -67,8 +67,8 @@
IN PVOID Buffer,
IN SIZE_T BufferLength)
{
- PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive;
- FILE *File = CmHive->HiveHandle;
+ PCMHIVE CmHive = (PCMHIVE)RegistryHive;
+ FILE *File = CmHive->FileHandles[HFILE_TYPE_PRIMARY];
if (0 != fseek (File, *FileOffset, SEEK_SET))
return FALSE;
return BufferLength == fwrite (Buffer, 1, BufferLength, File);
@@ -94,20 +94,20 @@
PLARGE_INTEGER FileOffset,
ULONG Length)
{
- PEREGISTRY_HIVE CmHive = (PEREGISTRY_HIVE)RegistryHive;
- FILE *File = CmHive->HiveHandle;
+ PCMHIVE CmHive = (PCMHIVE)RegistryHive;
+ FILE *File = CmHive->FileHandles[HFILE_TYPE_PRIMARY];
return 0 == fflush (File);
}
NTSTATUS
CmiInitializeTempHive(
- IN OUT PEREGISTRY_HIVE Hive)
+ IN OUT PCMHIVE Hive)
{
NTSTATUS Status;
RtlZeroMemory (
Hive,
- sizeof(EREGISTRY_HIVE));
+ sizeof(CMHIVE));
DPRINT("Hive 0x%p\n", Hive);
@@ -149,7 +149,7 @@
static NTSTATUS
CmiAddKeyToHashTable(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN OUT PCM_KEY_FAST_INDEX HashCell,
IN PCM_KEY_NODE KeyCell,
IN HSTORAGE_TYPE StorageType,
@@ -189,7 +189,7 @@
static NTSTATUS
CmiAllocateHashTableCell (
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
OUT PCM_KEY_FAST_INDEX *HashBlock,
OUT HCELL_INDEX *HBOffset,
IN USHORT SubKeyCount,
@@ -223,7 +223,7 @@
NTSTATUS
CmiAddSubKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE ParentKeyCell,
IN HCELL_INDEX ParentKeyCellOffset,
IN PCUNICODE_STRING SubKeyName,
@@ -513,7 +513,7 @@
NTSTATUS
CmiScanForSubKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN PCUNICODE_STRING SubKeyName,
IN ULONG Attributes,
@@ -611,7 +611,7 @@
static NTSTATUS
CmiAllocateValueCell(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
OUT PCM_KEY_VALUE *ValueCell,
OUT HCELL_INDEX *VBOffset,
IN PCUNICODE_STRING ValueName,
@@ -666,7 +666,7 @@
NTSTATUS
CmiAddValueKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN HCELL_INDEX KeyCellOffset,
IN PCUNICODE_STRING ValueName,
@@ -780,7 +780,7 @@
NTSTATUS
CmiScanForValueKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN PCUNICODE_STRING ValueName,
OUT PCM_KEY_VALUE *pValueCell,
Modified: trunk/reactos/tools/mkhive/cmi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/cmi.h?rev=299…
==============================================================================
--- trunk/reactos/tools/mkhive/cmi.h (original)
+++ trunk/reactos/tools/mkhive/cmi.h Mon Oct 29 01:38:20 2007
@@ -28,11 +28,11 @@
NTSTATUS
CmiInitializeTempHive(
- IN OUT PEREGISTRY_HIVE Hive);
+ IN OUT PCMHIVE Hive);
NTSTATUS
CmiAddSubKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE ParentKeyCell,
IN HCELL_INDEX ParentKeyCellOffset,
IN PCUNICODE_STRING SubKeyName,
@@ -42,7 +42,7 @@
NTSTATUS
CmiScanForSubKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN PCUNICODE_STRING SubKeyName,
IN ULONG Attributes,
@@ -51,7 +51,7 @@
NTSTATUS
CmiAddValueKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN HCELL_INDEX KeyCellOffset,
IN PCUNICODE_STRING ValueName,
@@ -60,7 +60,7 @@
NTSTATUS
CmiScanForValueKey(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE KeyCell,
IN PCUNICODE_STRING ValueName,
OUT PCM_KEY_VALUE *pValueCell,
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 (original)
+++ trunk/reactos/tools/mkhive/registry.c Mon Oct 29 01:38:20 2007
@@ -40,17 +40,17 @@
#define REG_DATA_SIZE_MASK 0x7FFFFFFF
#define REG_DATA_IN_OFFSET 0x80000000
-static EREGISTRY_HIVE RootHive;
+static CMHIVE RootHive;
static MEMKEY RootKey;
-EREGISTRY_HIVE DefaultHive; /* \Registry\User\.DEFAULT */
-EREGISTRY_HIVE SamHive; /* \Registry\Machine\SAM */
-EREGISTRY_HIVE SecurityHive; /* \Registry\Machine\SECURITY */
-EREGISTRY_HIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
-EREGISTRY_HIVE SystemHive; /* \Registry\Machine\SYSTEM */
+CMHIVE DefaultHive; /* \Registry\User\.DEFAULT */
+CMHIVE SamHive; /* \Registry\Machine\SAM */
+CMHIVE SecurityHive; /* \Registry\Machine\SECURITY */
+CMHIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
+CMHIVE SystemHive; /* \Registry\Machine\SYSTEM */
static MEMKEY
CreateInMemoryStructure(
- IN PEREGISTRY_HIVE RegistryHive,
+ IN PCMHIVE RegistryHive,
IN HCELL_INDEX KeyCellOffset,
IN PCUNICODE_STRING KeyName)
{
@@ -569,7 +569,7 @@
static BOOL
ConnectRegistry(
IN HKEY RootKey,
- IN PEREGISTRY_HIVE HiveToConnect,
+ IN PCMHIVE HiveToConnect,
IN LPCWSTR Path)
{
NTSTATUS Status;
@@ -599,7 +599,7 @@
static BOOL
MyExportBinaryHive (PCHAR FileName,
- PEREGISTRY_HIVE RootHive)
+ PCMHIVE RootHive)
{
FILE *File;
BOOL ret;
@@ -614,7 +614,7 @@
fseek (File, 0, SEEK_SET);
- RootHive->HiveHandle = (HANDLE)File;
+ RootHive->FileHandles[HFILE_TYPE_PRIMARY] = (HANDLE)File;
ret = HvWriteHive(&RootHive->Hive);
fclose (File);
return ret;
Modified: trunk/reactos/tools/mkhive/registry.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/registry.h?re…
==============================================================================
--- trunk/reactos/tools/mkhive/registry.h (original)
+++ trunk/reactos/tools/mkhive/registry.h Mon Oct 29 01:38:20 2007
@@ -41,7 +41,7 @@
/* Information on hard disk structure */
HCELL_INDEX KeyCellOffset;
PCM_KEY_NODE KeyCell;
- PEREGISTRY_HIVE RegistryHive;
+ PCMHIVE RegistryHive;
/* Used when linking to another key */
struct _REG_KEY* LinkedKey;
@@ -50,11 +50,11 @@
#define HKEY_TO_MEMKEY(hKey) ((MEMKEY)(hKey))
#define MEMKEY_TO_HKEY(memKey) ((HKEY)(memKey))
-extern EREGISTRY_HIVE DefaultHive; /* \Registry\User\.DEFAULT */
-extern EREGISTRY_HIVE SamHive; /* \Registry\Machine\SAM */
-extern EREGISTRY_HIVE SecurityHive; /* \Registry\Machine\SECURITY */
-extern EREGISTRY_HIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
-extern EREGISTRY_HIVE SystemHive; /* \Registry\Machine\SYSTEM */
+extern CMHIVE DefaultHive; /* \Registry\User\.DEFAULT */
+extern CMHIVE SamHive; /* \Registry\Machine\SAM */
+extern CMHIVE SecurityHive; /* \Registry\Machine\SECURITY */
+extern CMHIVE SoftwareHive; /* \Registry\Machine\SOFTWARE */
+extern CMHIVE SystemHive; /* \Registry\Machine\SYSTEM */
#define ERROR_SUCCESS 0L
#define ERROR_UNSUCCESSFUL 1L
@@ -127,3 +127,4 @@
/* EOF */
+