diff --git a/reactos/drivers/storage/class/ramdisk/ramdisk.c b/reactos/drivers/storage/class/ramdisk/ramdisk.c index 36dff708f16..55abad56586 100644 --- a/reactos/drivers/storage/class/ramdisk/ramdisk.c +++ b/reactos/drivers/storage/class/ramdisk/ramdisk.c @@ -379,13 +379,19 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject, { DPRINT1("PnP IRP: %lx\n", Minor); while (TRUE); - } + } break; case IRP_MN_QUERY_BUS_INFORMATION: - DPRINT1("PnP IRP: %lx\n", Minor); - while (TRUE); + // + // Are we a PDO? + // + if (DeviceExtension->Type == RamdiskPdo) + { + DPRINT1("PnP IRP: %lx\n", Minor); + while (TRUE); + } break; case IRP_MN_EJECT: @@ -396,8 +402,14 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject, case IRP_MN_QUERY_DEVICE_TEXT: - DPRINT1("PnP IRP: %lx\n", Minor); - while (TRUE); + // + // Are we a PDO? + // + if (DeviceExtension->Type == RamdiskPdo) + { + DPRINT1("PnP IRP: %lx\n", Minor); + while (TRUE); + } break; case IRP_MN_QUERY_DEVICE_RELATIONS: @@ -408,10 +420,25 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject, case IRP_MN_QUERY_CAPABILITIES: - DPRINT1("PnP IRP: %lx\n", Minor); - while (TRUE); + // + // Are we a PDO? + // + if (DeviceExtension->Type == RamdiskPdo) + { + DPRINT1("PnP IRP: %lx\n", Minor); + while (TRUE); + } break; + case IRP_MN_QUERY_RESOURCES: + case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: + + // + // Complete immediately without touching it + // + IoCompleteRequest(Irp, IO_NO_INCREMENT); + goto ReleaseAndReturn; + default: DPRINT1("Illegal IRP: %lx\n", Minor); @@ -439,6 +466,7 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject, // // Release the lock and return status // +ReleaseAndReturn: IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp); return Status; }