Author: ros-arm-bringup
Date: Sat Jul 19 23:39:01 2008
New Revision: 34602
URL:
http://svn.reactos.org/svn/reactos?rev=34602&view=rev
Log:
- Finish implementing RamdiskCreateDiskDevice -- we should now have a working ramdisk
drive that should receive read/write requests.
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] Sat Jul 19 23:39:01
2008
@@ -81,6 +81,9 @@
LONGLONG DiskLength;
LONG DiskOffset;
WCHAR DriveLetter;
+ ULONG BytesPerSector;
+ ULONG SectorsPerTrack;
+ ULONG NumberOfHeads;
} RAMDISK_DRIVE_EXTENSION, *PRAMDISK_DRIVE_EXTENSION;
ULONG MaximumViewLength;
@@ -491,7 +494,43 @@
DeviceName.Buffer = NULL;
SymbolicLinkName.Buffer = NULL;
GuidString.Buffer = NULL;
- }
+
+ //
+ // Only support ISO stuff for now
+ //
+ ASSERT(Input->Options.ExportAsCd == TRUE);
+ ASSERT(Input->DiskType == FILE_DEVICE_CD_ROM_FILE_SYSTEM);
+
+ //
+ // Setup partition parameters
+ //
+ DriveExtension->BytesPerSector = 2048; // 512 for Disk
+ DriveExtension->SectorsPerTrack = 32; // 128 for disk
+ DriveExtension->NumberOfHeads = 64; // 16 for disk
+
+ //
+ // Acquire the disk lock
+ //
+ KeEnterCriticalRegion();
+ ExAcquireFastMutex(&DeviceExtension->DiskListLock);
+
+ //
+ // Insert us
+ //
+ InsertTailList(&DeviceExtension->DiskList,
&DriveExtension->DiskList);
+
+ //
+ // Release the lock
+ //
+ ExReleaseFastMutex(&DeviceExtension->DiskListLock);
+ KeLeaveCriticalRegion();
+
+ //
+ // Clear init flag
+ //
+ DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+ return STATUS_SUCCESS;
+ }
FailCreate:
UNIMPLEMENTED;