mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 05:01:03 +00:00
[PCI] Fix PDO removal
We must not do anything on PDO removal, especially not deleting it. We are allowed to delete it, only once we successfully completed a IRP_MN_QUERY_DEVICE_RELATIONS without with PDO.
This commit is contained in:
parent
ea4af587a9
commit
2b9941e7cb
1 changed files with 1 additions and 24 deletions
|
@ -1577,34 +1577,11 @@ PdoPnpControl(
|
|||
case IRP_MN_STOP_DEVICE:
|
||||
case IRP_MN_QUERY_REMOVE_DEVICE:
|
||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||
case IRP_MN_REMOVE_DEVICE:
|
||||
case IRP_MN_SURPRISE_REMOVAL:
|
||||
Status = STATUS_SUCCESS;
|
||||
break;
|
||||
|
||||
case IRP_MN_REMOVE_DEVICE:
|
||||
{
|
||||
PPDO_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
||||
PFDO_DEVICE_EXTENSION FdoDeviceExtension = DeviceExtension->Fdo->DeviceExtension;
|
||||
KIRQL OldIrql;
|
||||
|
||||
/* Remove it from the device list */
|
||||
KeAcquireSpinLock(&FdoDeviceExtension->DeviceListLock, &OldIrql);
|
||||
RemoveEntryList(&DeviceExtension->PciDevice->ListEntry);
|
||||
FdoDeviceExtension->DeviceListCount--;
|
||||
KeReleaseSpinLock(&FdoDeviceExtension->DeviceListLock, OldIrql);
|
||||
|
||||
/* Free the device */
|
||||
ExFreePoolWithTag(DeviceExtension->PciDevice, TAG_PCI);
|
||||
|
||||
/* Complete the IRP */
|
||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
/* Delete the DO */
|
||||
IoDeleteDevice(DeviceObject);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
case IRP_MN_QUERY_INTERFACE:
|
||||
DPRINT("IRP_MN_QUERY_INTERFACE received\n");
|
||||
Status = PdoQueryInterface(DeviceObject, Irp, IrpSp);
|
||||
|
|
Loading…
Reference in a new issue