[ros-kernel] Bug in current source

Hartmut Birr hartmut.birr at gmx.de
Fri Jan 9 18:50:44 CET 2004


Hi,

it seems that the last changes to tools\mkhive\binhive.c should be also
applied to freeloader. If I start regexpl.exe, I get to different trees
if I boot with loadros or freeloader.

- Hartmut

loadros:
# dir

 Key is \hklm\
 Last modify time is 9.1.2004 18:38:07

        (KEY)                           ..\
        (KEY)                           SYSTEM\
        (KEY)                           HARDWARE\
        (KEY)                           SOFTWARE\
        (KEY)                           SAM\
        (KEY)                           SECURITY\

 Total: 6 item(s) listed.

freeloader:

# dir

 Key is \hklm\
 Last modify time is 9.1.2004 19:40:48

        (KEY)                           ..\
        (KEY)                           SYSTEM\
        (KEY)                           \
        (KEY)                           SOFTWARE\
        (KEY)                           SAM\
        (KEY)                           SECURITY\

 Total: 6 item(s) listed.

> -----Original Message-----
> From: ros-kernel-bounces at reactos.com 
> [mailto:ros-kernel-bounces at reactos.com] On Behalf Of Ge van Geldorp
> Sent: Friday, January 09, 2004 6:23 PM
> To: 'ReactOS Kernel List'
> Subject: RE: [ros-kernel] Bug in current source
> 
> 
> > > 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.
> 
> 
> _______________________________________________
> Ros-kernel mailing list
> Ros-kernel at reactos.com
> http://reactos.com/mailman/listinfo/ros-kernel
> 




More information about the Ros-kernel mailing list