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…
==============================================================================
--- 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,