- Reference/dereference the parent key in CmiObjectDelete.

The call to CmiRemoveKeyFromList does dereference the parent and
  it is possible that the parent key is deleted before the
  subkey delete process is complete.

svn path=/trunk/; revision=5938
This commit is contained in:
Hartmut Birr 2003-08-30 14:51:05 +00:00
parent 5a6cf4163c
commit 335e8718f7

View file

@ -271,6 +271,8 @@ CmiObjectDelete(PVOID DeletedObject)
DPRINT("Delete key object (%p)\n", DeletedObject);
KeyObject = (PKEY_OBJECT) DeletedObject;
ObReferenceObject(KeyObject->ParentKey);
if (!NT_SUCCESS(CmiRemoveKeyFromList(KeyObject)))
{
@ -292,6 +294,7 @@ CmiObjectDelete(PVOID DeletedObject)
CmiSyncHives();
}
}
ObDereferenceObject(KeyObject->ParentKey);
if (KeyObject->NumberOfSubKeys)
{
KEBUGCHECK(0);