mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:12:57 +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_STOP_DEVICE:
|
||||||
case IRP_MN_QUERY_REMOVE_DEVICE:
|
case IRP_MN_QUERY_REMOVE_DEVICE:
|
||||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||||
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
case IRP_MN_SURPRISE_REMOVAL:
|
case IRP_MN_SURPRISE_REMOVAL:
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
break;
|
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:
|
case IRP_MN_QUERY_INTERFACE:
|
||||||
DPRINT("IRP_MN_QUERY_INTERFACE received\n");
|
DPRINT("IRP_MN_QUERY_INTERFACE received\n");
|
||||||
Status = PdoQueryInterface(DeviceObject, Irp, IrpSp);
|
Status = PdoQueryInterface(DeviceObject, Irp, IrpSp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue