Do not dereference key objects if they are used to link hives.

svn path=/trunk/; revision=7526
This commit is contained in:
Eric Kohl 2004-01-09 19:42:40 +00:00
parent 8450d1eb80
commit cff5149eca

View file

@ -1,4 +1,4 @@
/* $Id: registry.c,v 1.117 2004/01/08 15:02:45 ekohl Exp $
/* $Id: registry.c,v 1.118 2004/01/09 19:42:40 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -622,7 +622,7 @@ CmiConnectHive(IN POBJECT_ATTRIBUTES KeyObjectAttributes,
VERIFY_KEY_OBJECT(NewKey);
ObDereferenceObject (NewKey);
/* Note: Do not dereference NewKey here! */
ObDereferenceObject (ParentKey);
return STATUS_SUCCESS;
@ -725,6 +725,8 @@ CmiDisconnectHive (IN POBJECT_ATTRIBUTES KeyObjectAttributes,
Entry = Entry->Flink;
}
/* Note: Dereference the key object twice in order to delete it */
ObDereferenceObject (KeyObject);
ObDereferenceObject (KeyObject);
*RegistryHive = Hive;