[ros-diffs] [cgutman] 56088: [NTOSKRNL] - Fix broken reference counting and dereferencing the wrong device object

cgutman at svn.reactos.org cgutman at svn.reactos.org
Thu Mar 8 02:58:22 UTC 2012


Author: cgutman
Date: Thu Mar  8 02:58:21 2012
New Revision: 56088

URL: http://svn.reactos.org/svn/reactos?rev=56088&view=rev
Log:
[NTOSKRNL]
- Fix broken reference counting and dereferencing the wrong device object

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/volume.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c?rev=56088&r1=56087&r2=56088&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/volume.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/volume.c [iso-8859-1] Thu Mar  8 02:58:21 2012
@@ -363,15 +363,11 @@
                                          DEVICE_OBJECT,
                                          Queue.ListEntry);
 
+        /* Get the attached device */
+        DeviceObject = IoGetAttachedDevice(DeviceObject);
+
         ObReferenceObject(DeviceObject);
         IopInterlockedIncrementUlong(LockQueueIoDatabaseLock, (PULONG)&DeviceObject->ReferenceCount);
-
-        /* Check if we're attached */
-        if (DeviceObject->AttachedDevice)
-        {
-            /* Get the attached device */
-            DeviceObject = IoGetAttachedDevice(DeviceObject);
-        }
 
         /* Build the shutdown IRP and call the driver */
         Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN,




More information about the Ros-diffs mailing list