From e0c8eedd512a9237000580634dd756ff0743fb18 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 8 Mar 2012 02:58:21 +0000 Subject: [PATCH] [NTOSKRNL] - Fix broken reference counting and dereferencing the wrong device object svn path=/trunk/; revision=56088 --- reactos/ntoskrnl/io/iomgr/volume.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/volume.c b/reactos/ntoskrnl/io/iomgr/volume.c index 460302bc561..7fe6df8a168 100644 --- a/reactos/ntoskrnl/io/iomgr/volume.c +++ b/reactos/ntoskrnl/io/iomgr/volume.c @@ -363,16 +363,12 @@ IopShutdownBaseFileSystems(IN PLIST_ENTRY ListHead) 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, DeviceObject,