KPROCESSOR_MODE PreviousMode;
UNICODE_STRING CapturedClass = {0};
HANDLE hKey;
+ PCM_KEY_NODE Node, ParentNode;
PAGED_CODE();
if (RemainingPath.Length == 0)
{
/* Fail if the key has been deleted */
- if (((PKEY_OBJECT) Object)->Flags & KO_MARKED_FOR_DELETE)
+ if (((PKEY_OBJECT) Object)->KeyControlBlock->Delete)
{
PostCreateKeyInfo.Object = NULL;
PostCreateKeyInfo.Status = STATUS_UNSUCCESSFUL;
ExAcquireResourceExclusiveLite(&CmpRegistryLock, TRUE);
/* Create the key */
- Status = CmpDoCreate(&((PKEY_OBJECT)Object)->RegistryHive->Hive,
- ((PKEY_OBJECT)Object)->KeyCellOffset,
+ Status = CmpDoCreate(((PKEY_OBJECT)Object)->KeyControlBlock->KeyHive,
+ ((PKEY_OBJECT)Object)->KeyControlBlock->KeyCell,
NULL,
&RemainingPath,
KernelMode,
RtlCreateUnicodeString(&KeyObject->Name, Start);
- KeyObject->KeyCell->Parent = KeyObject->ParentKey->KeyCellOffset;
- KeyObject->KeyCell->Security = KeyObject->ParentKey->KeyCell->Security;
- KeyObject->ValueCache.ValueList = KeyObject->KeyCell->ValueList.List;
- KeyObject->ValueCache.Count = KeyObject->KeyCell->ValueList.Count;
+ ParentNode = (PCM_KEY_NODE)HvGetCell(KeyObject->ParentKey->KeyControlBlock->KeyHive,
+ KeyObject->ParentKey->KeyControlBlock->KeyCell);
+
+ Node = (PCM_KEY_NODE)HvGetCell(KeyObject->KeyControlBlock->KeyHive,
+ KeyObject->KeyControlBlock->KeyCell);
+
+ Node->Parent = KeyObject->ParentKey->KeyControlBlock->KeyCell;
+ Node->Security = ParentNode->Security;
+
+ KeyObject->KeyControlBlock->ValueCache.ValueList = Node->ValueList.List;
+ KeyObject->KeyControlBlock->ValueCache.Count = Node->ValueList.Count;
DPRINT("RemainingPath: %wZ\n", &RemainingPath);
VERIFY_KEY_OBJECT(KeyObject);
- RegistryHive = KeyObject->RegistryHive;
+ RegistryHive = (PCMHIVE)KeyObject->KeyControlBlock->KeyHive;
/* Acquire hive lock */
KeEnterCriticalRegion();
RtlFreeUnicodeString(&RemainingPath);
/* Fail if the key has been deleted */
- if (((PKEY_OBJECT)Object)->Flags & KO_MARKED_FOR_DELETE)
+ if (((PKEY_OBJECT)Object)->KeyControlBlock->Delete)
{
Status = STATUS_UNSUCCESSFUL;
goto openkey_cleanup;
Status = CmiCallRegisteredCallbacks(RegNtPreDeleteKey, &DeleteKeyInfo);
if (NT_SUCCESS(Status))
{
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
/* Call the internal API */
- Status = CmDeleteKey(&DummyKcb);
+ Status = CmDeleteKey(KeyObject->KeyControlBlock);
/* Remove the keep-alive reference */
ObDereferenceObject(KeyObject);
- if (KeyObject->RegistryHive != KeyObject->ParentKey->RegistryHive)
+ if (KeyObject->KeyControlBlock->KeyHive !=
+ KeyObject->ParentKey->KeyControlBlock->KeyHive)
{
/* Dereference again */
ObDereferenceObject(KeyObject);
Status = CmiCallRegisteredCallbacks(RegNtPreEnumerateKey, &EnumerateKeyInfo);
if (NT_SUCCESS(Status))
{
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
/* Call the internal API */
- Status = CmEnumerateKey(&DummyKcb,
+ Status = CmEnumerateKey(KeyObject->KeyControlBlock,
Index,
KeyInformationClass,
KeyInformation,
&EnumerateValueKeyInfo);
if (NT_SUCCESS(Status))
{
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
/* Call the internal API */
- Status = CmEnumerateValueKey(&DummyKcb,
+ Status = CmEnumerateValueKey(KeyObject->KeyControlBlock,
Index,
KeyValueInformationClass,
KeyValueInformation,
Status = CmiCallRegisteredCallbacks(RegNtPreQueryKey, &QueryKeyInfo);
if (NT_SUCCESS(Status))
{
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
/* Call the internal API */
- Status = CmQueryKey(&DummyKcb,
+ Status = CmQueryKey(KeyObject->KeyControlBlock,
KeyInformationClass,
KeyInformation,
Length,
Status = CmiCallRegisteredCallbacks(RegNtPreQueryValueKey, &QueryValueKeyInfo);
if (NT_SUCCESS(Status))
{
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
/* Call the internal API */
- Status = CmQueryValueKey(&DummyKcb,
+ Status = CmQueryValueKey(KeyObject->KeyControlBlock,
*ValueName,
KeyValueInformationClass,
KeyValueInformation,
/* Do the callback */
Status = CmiCallRegisteredCallbacks(RegNtPreSetValueKey, &SetValueKeyInfo);
if (NT_SUCCESS(Status))
- {
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
+ {
/* Call the internal API */
- Status = CmSetValueKey(&DummyKcb,
+ Status = CmSetValueKey(KeyObject->KeyControlBlock,
ValueName,
Type,
Data,
&DeleteValueKeyInfo);
if (NT_SUCCESS(Status))
{
- /* HACK: Setup the Dummy KCB */
- CM_KEY_CONTROL_BLOCK DummyKcb = {0};
- DummyKcb.KeyHive = &KeyObject->RegistryHive->Hive;
- DummyKcb.KeyCell = KeyObject->KeyCellOffset;
-
/* Call the internal API */
- Status = CmDeleteValueKey(&DummyKcb, *ValueName);
+ Status = CmDeleteValueKey(KeyObject->KeyControlBlock, *ValueName);
/* Do the post callback */
PostOperationInfo.Object = (PVOID)KeyObject;