[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,15 +363,11 @@ IopShutdownBaseFileSystems(IN PLIST_ENTRY ListHead)
DEVICE_OBJECT, DEVICE_OBJECT,
Queue.ListEntry); Queue.ListEntry);
ObReferenceObject(DeviceObject);
IopInterlockedIncrementUlong(LockQueueIoDatabaseLock, (PULONG)&DeviceObject->ReferenceCount);
/* Check if we're attached */
if (DeviceObject->AttachedDevice)
{
/* Get the attached device */ /* Get the attached device */
DeviceObject = IoGetAttachedDevice(DeviceObject); DeviceObject = IoGetAttachedDevice(DeviceObject);
}
ObReferenceObject(DeviceObject);
IopInterlockedIncrementUlong(LockQueueIoDatabaseLock, (PULONG)&DeviceObject->ReferenceCount);
/* Build the shutdown IRP and call the driver */ /* Build the shutdown IRP and call the driver */
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN, Irp = IoBuildSynchronousFsdRequest(IRP_MJ_SHUTDOWN,