Author: fireball
Date: Thu Nov 1 01:22:07 2007
New Revision: 30026
URL:
http://svn.reactos.org/svn/reactos?rev=30026&view=rev
Log:
- Get rid of parent key member in PKEY_OBJECT, and use ParentKcb instead.
- Modify more functions to use KCB instead of PKEY_OBJECT.
Modified:
trunk/reactos/ntoskrnl/cm/ntfunc.c
trunk/reactos/ntoskrnl/cm/registry.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 Nov 1 01:22:07 2007
@@ -313,7 +313,7 @@
KernelMode,
Class,
CreateOptions,
- (PKEY_OBJECT)Object,
+ ((PKEY_OBJECT)Object)->KeyControlBlock,
NULL,
(PVOID*)&KeyObject);
if (!NT_SUCCESS(Status))
@@ -333,13 +333,13 @@
RtlCreateUnicodeString(&KeyObject->Name, Start);
- ParentNode =
(PCM_KEY_NODE)HvGetCell(KeyObject->ParentKey->KeyControlBlock->KeyHive,
-
KeyObject->ParentKey->KeyControlBlock->KeyCell);
+ ParentNode =
(PCM_KEY_NODE)HvGetCell(KeyObject->KeyControlBlock->ParentKcb->KeyHive,
+
KeyObject->KeyControlBlock->ParentKcb->KeyCell);
Node = (PCM_KEY_NODE)HvGetCell(KeyObject->KeyControlBlock->KeyHive,
KeyObject->KeyControlBlock->KeyCell);
- Node->Parent = KeyObject->ParentKey->KeyControlBlock->KeyCell;
+ Node->Parent = KeyObject->KeyControlBlock->ParentKcb->KeyCell;
Node->Security = ParentNode->Security;
KeyObject->KeyControlBlock->ValueCache.ValueList = Node->ValueList.List;
@@ -347,7 +347,7 @@
DPRINT("RemainingPath: %wZ\n", &RemainingPath);
- CmiAddKeyToList(KeyObject->ParentKey, KeyObject);
+ CmiAddKeyToList(((PKEY_OBJECT)Object), KeyObject);
VERIFY_KEY_OBJECT(KeyObject);
@@ -722,7 +722,7 @@
/* Remove the keep-alive reference */
ObDereferenceObject(KeyObject);
if (KeyObject->KeyControlBlock->KeyHive !=
- KeyObject->ParentKey->KeyControlBlock->KeyHive)
+ KeyObject->KeyControlBlock->ParentKcb->KeyHive)
{
/* Dereference again */
ObDereferenceObject(KeyObject);
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 Thu Nov 1 01:22:07 2007
@@ -213,7 +213,7 @@
KernelMode,
NULL,
REG_OPTION_VOLATILE,
- ParentKey,
+ ParentKey->KeyControlBlock,
NULL,
(PVOID*)&NewKey);
if (!NT_SUCCESS(Status))
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 Nov 1 01:22:07 2007
@@ -625,7 +625,6 @@
NTAPI
CmpDeleteKeyObject(PVOID DeletedObject)
{
- PKEY_OBJECT ParentKeyObject;
PKEY_OBJECT KeyObject;
REG_KEY_HANDLE_CLOSE_INFORMATION KeyHandleCloseInfo;
REG_POST_OPERATION_INFORMATION PostOperationInfo;
@@ -634,9 +633,7 @@
DPRINT("Delete key object (%p)\n", DeletedObject);
KeyObject = (PKEY_OBJECT) DeletedObject;
- ParentKeyObject = KeyObject->ParentKey;
-
- ObReferenceObject (ParentKeyObject);
+
PostOperationInfo.Object = (PVOID)KeyObject;
KeyHandleCloseInfo.Object = (PVOID)KeyObject;
@@ -645,7 +642,6 @@
{
PostOperationInfo.Status = Status;
CmiCallRegisteredCallbacks(RegNtPostKeyHandleClose, &PostOperationInfo);
- ObDereferenceObject (ParentKeyObject);
return;
}
@@ -657,8 +653,6 @@
RtlFreeUnicodeString(&KeyObject->Name);
ASSERT((KeyObject->KeyControlBlock->Delete) == FALSE);
-
- ObDereferenceObject (ParentKeyObject);
if (KeyObject->SizeOfSubKeys)
{
@@ -680,14 +674,15 @@
PULONG ReturnLength,
IN KPROCESSOR_MODE PreviousMode)
{
+ DPRINT1("CmpQueryKeyName() called\n");
+ while (TRUE);
+#if 0
PKEY_OBJECT KeyObject;
NTSTATUS Status;
- DPRINT ("CmpQueryKeyName() called\n");
-
KeyObject = (PKEY_OBJECT)ObjectBody;
- if (KeyObject->ParentKey != KeyObject)
+ if (KeyObject->KeyControlBlock->ParentKcb != KeyObject->KeyControlBlock)
{
Status = ObQueryNameString (KeyObject->ParentKey,
ObjectNameInfo,
@@ -734,8 +729,9 @@
{
DPRINT ("Total path: %wZ\n", &ObjectNameInfo->Name);
}
-
- return Status;
+#endif
+
+ return STATUS_SUCCESS;
}
VOID
@@ -773,7 +769,7 @@
STANDARD_RIGHTS_REQUIRED,
CmpKeyObjectType,
KernelMode);
- NewKey->ParentKey = ParentKey;
+ //NewKey->ParentKey = ParentKey;
}
/* Preconditions: Must be called with CmpRegistryLock held. */
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 Nov 1 01:22:07 2007
@@ -507,7 +507,6 @@
{
ULONG Type;
UNICODE_STRING Name;
- struct _KEY_OBJECT *ParentKey;
LIST_ENTRY KeyBodyList;
ULONG SubKeyCounts;
ULONG SizeOfSubKeys;
@@ -975,7 +974,7 @@
IN KPROCESSOR_MODE AccessMode,
IN PUNICODE_STRING Class,
IN ULONG CreateOptions,
- IN PKEY_OBJECT Parent,
+ 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 Nov 1 01:22:07 2007
@@ -83,7 +83,7 @@
IN PUNICODE_STRING Name,
IN KPROCESSOR_MODE AccessMode,
IN PUNICODE_STRING Class,
- IN PKEY_OBJECT Parent,
+ IN PCM_KEY_CONTROL_BLOCK ParentKcb,
IN ULONG CreateOptions,
OUT PHCELL_INDEX KeyCell,
OUT PVOID *Object)
@@ -214,7 +214,7 @@
Kcb = CmpCreateKeyControlBlock(Hive,
*KeyCell,
KeyNode,
- Parent->KeyControlBlock,
+ ParentKcb,
0,
Name);
if (!Kcb)
@@ -233,7 +233,6 @@
KeyBody->SubKeyCounts = 0;
KeyBody->SubKeys = NULL;
KeyBody->SizeOfSubKeys = 0;
- KeyBody->ParentKey = Parent;
InsertTailList(&CmiKeyObjectListHead, &KeyBody->KeyBodyList);
Quickie:
@@ -267,7 +266,7 @@
IN KPROCESSOR_MODE AccessMode,
IN PUNICODE_STRING Class OPTIONAL,
IN ULONG CreateOptions,
- IN PKEY_OBJECT Parent,
+ IN PCM_KEY_CONTROL_BLOCK ParentKcb,
IN PCMHIVE OriginatingHive OPTIONAL,
OUT PVOID *Object)
{
@@ -286,7 +285,7 @@
ExAcquirePushLockShared((PVOID)&((PCMHIVE)Hive)->FlusherLock);
/* Check if the parent is being deleted */
- if (Parent->KeyControlBlock->Delete)
+ if (ParentKcb->Delete)
{
/* It has, quit */
ASSERT(FALSE);
@@ -314,7 +313,7 @@
}
/* Sanity check */
- ASSERT(Cell == Parent->KeyControlBlock->KeyCell);
+ ASSERT(Cell == ParentKcb->KeyCell);
/* Get the parent type */
ParentType = HvGetCellType(Cell);
@@ -327,7 +326,7 @@
}
/* Don't allow children under symlinks */
- if (Parent->KeyControlBlock->Flags & KEY_SYM_LINK)
+ if (ParentKcb->Flags & KEY_SYM_LINK)
{
/* Fail */
ASSERT(FALSE);
@@ -346,7 +345,7 @@
Name,
AccessMode,
Class,
- Parent,
+ ParentKcb,
CreateOptions,
&KeyCell,
Object);
@@ -371,9 +370,10 @@
}
/* Sanity checks */
- ASSERT(KeyBody->ParentKey->KeyControlBlock->KeyCell == Cell);
- ASSERT(KeyBody->ParentKey->KeyControlBlock->KeyHive == Hive);
- ASSERT(KeyBody->ParentKey == Parent);
+ ASSERT(KeyBody->KeyControlBlock->ParentKcb->KeyCell == Cell);
+ ASSERT(KeyBody->KeyControlBlock->ParentKcb->KeyHive == Hive);
+ ASSERT(KeyBody->KeyControlBlock->ParentKcb == ParentKcb);
+ //ASSERT(KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen ==
KeyNode->MaxNameLen);
/* Update the timestamp */
KeQuerySystemTime(&TimeStamp);
@@ -384,6 +384,7 @@
{
/* Do it */
KeyNode->MaxNameLen = Name->Length;
+ KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen =
Name->Length;
}
/* Check if we need toupdate class length maximum */
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 Nov 1 01:22:07 2007
@@ -715,7 +715,6 @@
RootKey->ProcessID = PsGetCurrentProcessId();
#else
RtlpCreateUnicodeString(&RootKey->Name, L"Registry", NonPagedPool);
- RootKey->ParentKey = RootKey;
RootKey->SubKeyCounts = 0;
RootKey->SubKeys = NULL;
RootKey->SizeOfSubKeys = 0;