[NTOSKRNL]

- Fix broken reference counting and dereferencing the wrong device object

svn path=/trunk/; revision=56088
This commit is contained in:
Cameron Gutman 2012-03-08 02:58:21 +00:00
parent 592be28128
commit e0c8eedd51

View file

@ -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,