- Fix the parameters we were sending to IoCreateDevice for our drive FDO.
authorReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Sun, 20 Jul 2008 06:32:23 +0000 (06:32 +0000)
committerReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Sun, 20 Jul 2008 06:32:23 +0000 (06:32 +0000)
- Now the kernel attempts to mount us through CDFS!
- Start stubbing the work we'll need to do in RamdiskDeviceControl -- this is where the emulation magic will happen.

svn path=/trunk/; revision=34604

reactos/drivers/storage/class/ramdisk/ramdisk.c

index 941320f..5bed68a 100644 (file)
@@ -11,6 +11,7 @@
 #include <initguid.h>
 #include <ntddk.h>
 #include <ntdddisk.h>
+#include <ntddcdrm.h>
 #include <scsi.h>
 #include <ntddscsi.h>
 #include <mountdev.h>
@@ -371,8 +372,8 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
         Status = IoCreateDevice(DeviceExtension->DeviceObject->DriverObject,
                                 sizeof(RAMDISK_DRIVE_EXTENSION),
                                 &DeviceName,
-                                FILE_DEVICE_DISK_FILE_SYSTEM, // FIXME: DISK
-                                FILE_READ_ONLY_DEVICE, // FIXME: Not always
+                                FILE_DEVICE_CD_ROM,
+                                0,
                                 0,
                                 &DeviceObject);
         if (!NT_SUCCESS(Status)) goto FailCreate;
@@ -906,9 +907,44 @@ RamdiskDeviceControl(IN PDEVICE_OBJECT DeviceObject,
     else
     {
         //
-        // Drive code not yet done
+        // Check what the request is
         //
-        ASSERT(FALSE);
+        switch (IoStackLocation->Parameters.DeviceIoControl.IoControlCode)
+        {
+            case IOCTL_CDROM_CHECK_VERIFY:
+                
+                UNIMPLEMENTED;
+                while (TRUE);
+                break;
+                
+            case IOCTL_CDROM_GET_DRIVE_GEOMETRY:
+                
+                UNIMPLEMENTED;
+                while (TRUE);
+                break;
+                
+            case IOCTL_CDROM_READ_TOC:
+                
+                UNIMPLEMENTED;
+                while (TRUE);
+                break;
+                
+            default:
+         
+                //
+                // Drive code not yet done
+                //
+                DPRINT1("IOCTL: %lx\n", IoStackLocation->Parameters.DeviceIoControl.IoControlCode);                
+                UNIMPLEMENTED;
+                while (TRUE);
+                break;
+        }
+
+        //
+        // Cleanup/complete
+        //
+        UNIMPLEMENTED;
+        while (TRUE);
     }
     
     //