Author: fireball
Date: Thu Dec 6 21:31:37 2007
New Revision: 31046
URL:
http://svn.reactos.org/svn/reactos?rev=31046&view=rev
Log:
- Remove CmiAddKeyToList.
- Use ParseContext in CmpDoCreate, removing OriginatingHive parameter since ReactOS
doesn't use this.
- Sending the create options as key node flags is wrong -- identify this in the code
(fixing this however will break the boot -- need to investigate).
Modified:
trunk/reactos/ntoskrnl/cm/ntfunc.c
trunk/reactos/ntoskrnl/cm/regobj.c
trunk/reactos/ntoskrnl/config/cm.h
trunk/reactos/ntoskrnl/config/cmparse.c
trunk/reactos/ntoskrnl/config/cmsysini.c
Modified: trunk/reactos/ntoskrnl/cm/ntfunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/ntfunc.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/ntfunc.c (original)
+++ trunk/reactos/ntoskrnl/cm/ntfunc.c Thu Dec 6 21:31:37 2007
@@ -52,7 +52,13 @@
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
HANDLE hKey;
PCM_KEY_NODE Node, ParentNode;
+ CM_PARSE_CONTEXT ParseContext = {0};
PAGED_CODE();
+
+ /* Setup the parse context */
+ ParseContext.CreateOperation = TRUE;
+ ParseContext.CreateOptions = CreateOptions;
+ if (Class) ParseContext.Class = *Class;
/* Capture all the info */
Status = ObpCaptureObjectAttributes(ObjectAttributes,
@@ -146,10 +152,8 @@
NULL,
&RemainingPath,
KernelMode,
- Class,
- CreateOptions,
+ &ParseContext,
Parent->KeyControlBlock,
- NULL,
(PVOID*)&KeyObject);
if (!NT_SUCCESS(Status)) goto Cleanup;
@@ -175,7 +179,7 @@
KeyObject->KeyControlBlock->ValueCache.Count = Node->ValueList.Count;
/* Link child to parent */
- CmiAddKeyToList(Parent->KeyControlBlock, KeyObject);
+ InsertTailList(&Parent->KeyControlBlock->KeyBodyListHead,
&KeyObject->KeyBodyEntry);
/* Create the actual handle to the object */
Status = CmpCreateHandle(KeyObject,
Modified: trunk/reactos/ntoskrnl/cm/regobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/regobj.c?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/regobj.c (original)
+++ trunk/reactos/ntoskrnl/cm/regobj.c Thu Dec 6 21:31:37 2007
@@ -720,7 +720,7 @@
FoundObject->KeyControlBlock = Kcb;
ASSERT(FoundObject->KeyControlBlock->KeyHive ==
ParsedKey->KeyControlBlock->KeyHive);
RtlpCreateUnicodeString(&FoundObject->Name, KeyName.Buffer,
NonPagedPool);
- CmiAddKeyToList(ParsedKey->KeyControlBlock, FoundObject);
+ InsertTailList(&ParsedKey->KeyControlBlock->KeyBodyListHead,
&FoundObject->KeyBodyEntry);
DPRINT("Created object 0x%p\n", FoundObject);
}
else
@@ -903,13 +903,6 @@
return STATUS_SUCCESS;
}
-VOID
-CmiAddKeyToList(PCM_KEY_CONTROL_BLOCK ParentKey,
- PKEY_OBJECT NewKey)
-{
- InsertTailList(&ParentKey->KeyBodyListHead, &NewKey->KeyBodyEntry);
-}
-
static NTSTATUS
CmiGetLinkTarget(PCMHIVE RegistryHive,
PCM_KEY_NODE KeyCell,
Modified: trunk/reactos/ntoskrnl/config/cm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cm.h?rev=3…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cm.h (original)
+++ trunk/reactos/ntoskrnl/config/cm.h Thu Dec 6 21:31:37 2007
@@ -507,9 +507,6 @@
IN PACCESS_STATE AccessState,
IN PVOID ParseContext);
NTSTATUS CmiCallRegisteredCallbacks(IN REG_NOTIFY_CLASS Argument1, IN PVOID Argument2);
-VOID
-CmiAddKeyToList(IN PCM_KEY_CONTROL_BLOCK ParentKey,
- IN PKEY_OBJECT NewKey);
///////////////////////////////////////////////////////////////////////////////
//
@@ -1029,10 +1026,8 @@
IN PACCESS_STATE AccessState,
IN PUNICODE_STRING Name,
IN KPROCESSOR_MODE AccessMode,
- IN PUNICODE_STRING Class,
- IN ULONG CreateOptions,
+ IN PCM_PARSE_CONTEXT Context,
IN PCM_KEY_CONTROL_BLOCK ParentKcb,
- IN PCMHIVE OriginatingHive OPTIONAL,
OUT PVOID *Object
);
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 Thu Dec 6 21:31:37 2007
@@ -82,9 +82,9 @@
IN PACCESS_STATE AccessState,
IN PUNICODE_STRING Name,
IN KPROCESSOR_MODE AccessMode,
- IN PUNICODE_STRING Class,
+ IN PCM_PARSE_CONTEXT ParseContext,
IN PCM_KEY_CONTROL_BLOCK ParentKcb,
- IN ULONG CreateOptions,
+ IN ULONG Flags,
OUT PHCELL_INDEX KeyCell,
OUT PVOID *Object)
{
@@ -110,7 +110,7 @@
/* Get the storage type */
StorageType = Stable;
- if (CreateOptions & REG_OPTION_VOLATILE) StorageType = Volatile;
+ if (Flags & REG_OPTION_VOLATILE) StorageType = Volatile;
/* Allocate the child */
*KeyCell = HvAllocateCell(Hive,
@@ -139,10 +139,13 @@
HvReleaseCell(Hive, *KeyCell);
/* Check if we have a class name */
- if (Class->Length > 0)
+ if (ParseContext->Class.Length > 0)
{
/* Allocate a class cell */
- ClassCell = HvAllocateCell(Hive, Class->Length, StorageType, HCELL_NIL);
+ ClassCell = HvAllocateCell(Hive,
+ ParseContext->Class.Length,
+ StorageType,
+ HCELL_NIL);
if (ClassCell == HCELL_NIL)
{
/* Fail */
@@ -165,7 +168,7 @@
KeyBody = (PKEY_OBJECT)(*Object);
/* Check if we had a class */
- if (Class->Length > 0)
+ if (ParseContext->Class.Length > 0)
{
/* Get the class cell */
CellData = HvGetCell(Hive, ClassCell);
@@ -183,13 +186,13 @@
/* Copy the class data */
RtlCopyMemory(&CellData->u.KeyString[0],
- Class->Buffer,
- Class->Length);
+ ParseContext->Class.Buffer,
+ ParseContext->Class.Length);
}
/* Fill out the key node */
KeyNode->Signature = CM_KEY_NODE_SIGNATURE;
- KeyNode->Flags = CreateOptions;
+ KeyNode->Flags = Flags;
KeQuerySystemTime(&SystemTime);
KeyNode->LastWriteTime = SystemTime;
KeyNode->Spare = 0;
@@ -202,7 +205,7 @@
KeyNode->ValueList.List = HCELL_NIL;
KeyNode->Security = HCELL_NIL;
KeyNode->Class = ClassCell;
- KeyNode->ClassLength = Class->Length;
+ KeyNode->ClassLength = ParseContext->Class.Length;
KeyNode->MaxValueDataLen = 0;
KeyNode->MaxNameLen = 0;
KeyNode->MaxValueNameLen = 0;
@@ -236,7 +239,7 @@
if (!NT_SUCCESS(Status))
{
/* Free any cells we might've allocated */
- if (Class->Length > 0) HvFreeCell(Hive, ClassCell);
+ if (ParseContext->Class.Length > 0) HvFreeCell(Hive, ClassCell);
HvFreeCell(Hive, *KeyCell);
}
@@ -260,10 +263,8 @@
IN PACCESS_STATE AccessState,
IN PUNICODE_STRING Name,
IN KPROCESSOR_MODE AccessMode,
- IN PUNICODE_STRING Class OPTIONAL,
- IN ULONG CreateOptions,
+ IN PCM_PARSE_CONTEXT ParseContext,
IN PCM_KEY_CONTROL_BLOCK ParentKcb,
- IN PCMHIVE OriginatingHive OPTIONAL,
OUT PVOID *Object)
{
NTSTATUS Status;
@@ -274,8 +275,6 @@
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
LARGE_INTEGER TimeStamp;
PCM_KEY_NODE KeyNode;
- UNICODE_STRING LocalClass = {0};
- if (!Class) Class = &LocalClass;
/* Sanity check */
#if 0
@@ -319,7 +318,8 @@
/* Get the parent type */
ParentType = HvGetCellType(Cell);
- if ((ParentType == Volatile) && !(CreateOptions & REG_OPTION_VOLATILE))
+ if ((ParentType == Volatile) &&
+ !(ParseContext->CreateOptions & REG_OPTION_VOLATILE))
{
/* Children of volatile parents must also be volatile */
ASSERT(FALSE);
@@ -346,9 +346,9 @@
AccessState,
Name,
AccessMode,
- Class,
+ ParseContext,
ParentKcb,
- CreateOptions,
+ ParseContext->CreateOptions, // WRONG!
&KeyCell,
Object);
if (NT_SUCCESS(Status))
@@ -391,14 +391,14 @@
}
/* Check if we need toupdate class length maximum */
- if (KeyNode->MaxClassLen < Class->Length)
+ if (KeyNode->MaxClassLen < ParseContext->Class.Length)
{
/* Update it */
- KeyNode->MaxClassLen = Class->Length;
+ KeyNode->MaxClassLen = ParseContext->Class.Length;
}
/* Check if we're creating a symbolic link */
- if (CreateOptions & REG_OPTION_CREATE_LINK)
+ if (ParseContext->CreateOptions & REG_OPTION_CREATE_LINK)
{
/* Get the cell data */
CellData = HvGetCell(Hive, KeyCell);
@@ -591,7 +591,7 @@
AccessState,
AccessMode,
CreateOptions,
- NULL,
+ Context,
0,
&Kcb,
&Name,
@@ -607,7 +607,7 @@
AccessState,
&Name,
AccessMode,
- &Context->Class,
+ Context,
ParentKcb,
KEY_HIVE_ENTRY | KEY_NO_DELETE,
&ChildCell,
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 Thu Dec 6 21:31:37 2007
@@ -614,7 +614,7 @@
ObReferenceObject(NewKey);
/* Link this key to the parent */
- CmiAddKeyToList(ParentKey->KeyControlBlock, NewKey);
+ InsertTailList(&ParentKey->KeyControlBlock->KeyBodyListHead,
&NewKey->KeyBodyEntry);
return STATUS_SUCCESS;
}