[ros-kernel] Bug in current source

Ge van Geldorp ge at gse.nl
Fri Jan 9 18:22:41 CET 2004


> > I booted ReactOS via loadros.com several times today and
> > didn't see any problems.
> 
> Ok, since I can reproduce it I'll dig a little deeper then.

The problem seems to be at the end of CmiConnectHive() in
ntoskrnl/cm/registry.c. The old code there is:


  CmiAddKeyToList (ParentKey, NewKey);
  ObDereferenceObject (ParentKey);

  VERIFY_KEY_OBJECT(NewKey);

  /* Note: Do not dereference NewKey here! */

  return STATUS_SUCCESS;

while the current code is:

  CmiAddKeyToList (ParentKey, NewKey);

  VERIFY_KEY_OBJECT(NewKey);

  ObDereferenceObject (NewKey);
  ObDereferenceObject (ParentKey);

  return STATUS_SUCCESS;

As you can see, NewKey is dereferenced now, against the previous
advice... When connecting the hardware hive this dereference will cause
the refcount of NewKey to go to 0, resulting in the deleting of the
entire hive.
What I don't understand is why you don't see this problem using loadros
though....

Gé van Geldorp.




More information about the Ros-kernel mailing list