CmpLockRegistry();
/* Make sure this is a valid key body */
- if (KeyBody->Type == '20yk')
+ if (KeyBody->Type == CM_KEY_BODY_TYPE)
{
/* Get the KCB */
Kcb = KeyBody->KeyControlBlock;
if (SystemHandleCount > 1) return;
/* Make sure we're a valid key body */
- if (KeyBody->Type == '20yk')
+ if (KeyBody->Type == CM_KEY_BODY_TYPE)
{
/* Don't do anything if we don't have a notify block */
if (!KeyBody->NotifyBlock) return;
LogHandle,
NULL,
HiveName,
- 0);
+ CheckFlags);
if (!NT_SUCCESS(Status))
{
/* Fail */
/* Success, return hive */
*Hive = NewHive;
- /* ROS: Init root key cell and prepare the hive */
+ /* HACK: ROS: Init root key cell and prepare the hive */
if (Operation == HINIT_CREATE) CmCreateRootNode(&NewHive->Hive, L"");
/* Duplicate the hive name */
NULL,
0,
&KeyName);
- if (!Kcb) return FALSE;
+ if (!Kcb)
+ {
+ ObDereferenceObject(RootKey);
+ return FALSE;
+ }
/* Initialize the object */
RootKey->KeyControlBlock = Kcb;
- RootKey->Type = '20yk';
+ RootKey->Type = CM_KEY_BODY_TYPE;
RootKey->NotifyBlock = NULL;
RootKey->ProcessID = PsGetCurrentProcessId();
0,
NULL,
&CmpRegistryRootHandle);
- if (!NT_SUCCESS(Status)) return FALSE;
+ if (!NT_SUCCESS(Status))
+ {
+ ObDereferenceObject(RootKey);
+ return FALSE;
+ }
/* Reference the key again so that we never lose it */
Status = ObReferenceObjectByHandle(CmpRegistryRootHandle,
KernelMode,
(PVOID*)&RootKey,
NULL);
- if (!NT_SUCCESS(Status)) return FALSE;
+ if (!NT_SUCCESS(Status))
+ {
+ ObDereferenceObject(RootKey);
+ return FALSE;
+ }
/* Completely sucessful */
return TRUE;