Author: pschweitzer
Date: Mon Dec 29 23:14:42 2014
New Revision: 65902
URL:
http://svn.reactos.org/svn/reactos?rev=65902&view=rev
Log:
[RAMDISK]
Implement RamdiskQueryDeviceRelations() when the device is a drive
According to Hervé, this allows booting ReactOS livecd using PXE (with one of his patch).
Modified:
trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramd…
==============================================================================
--- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Mon Dec 29 23:14:42
2014
@@ -1731,10 +1731,45 @@
DeviceExtension = DeviceObject->DeviceExtension;
if (DeviceExtension->Type == RamdiskDrive)
{
- //
- // FIXME: TODO
- //
- UNIMPLEMENTED_DBGBREAK();
+ NTSTATUS Status;
+ PDEVICE_RELATIONS DeviceRelations;
+
+ //
+ // We're a child device, only handle target device relations
+ //
+ if (Type != TargetDeviceRelation)
+ {
+ Status = Irp->IoStatus.Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
+
+ //
+ // Allocate a buffer big enough to contain only one DO
+ //
+ DeviceRelations = ExAllocatePoolWithTag(PagedPool, sizeof(DeviceRelations),
'dmaR');
+ if (DeviceRelations != NULL)
+ {
+ //
+ // Reference the DO and add it to the buffer
+ //
+ ObReferenceObject(DeviceObject);
+ DeviceRelations->Objects[0] = DeviceObject;
+ DeviceRelations->Count = 1;
+ Status = STATUS_SUCCESS;
+ }
+ else
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ //
+ // Return our processing & complete
+ //
+ Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
}
//