Set filesystem characteristics.
authorSylvain Petreolle <spetreolle@yahoo.fr>
Sun, 6 Dec 2009 18:49:19 +0000 (18:49 +0000)
committerSylvain Petreolle <spetreolle@yahoo.fr>
Sun, 6 Dec 2009 18:49:19 +0000 (18:49 +0000)
Floppy disks and cdroms are now reported as removable.

svn path=/trunk/; revision=44442

reactos/drivers/filesystems/cdfs/fsctl.c
reactos/drivers/filesystems/cdfs/volinfo.c
reactos/drivers/filesystems/fastfat/fsctl.c
reactos/drivers/filesystems/fastfat/volume.c

index 146344f..897c081 100644 (file)
@@ -332,7 +332,7 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
         sizeof(DEVICE_EXTENSION),
         NULL,
         FILE_DEVICE_CD_ROM_FILE_SYSTEM,
         sizeof(DEVICE_EXTENSION),
         NULL,
         FILE_DEVICE_CD_ROM_FILE_SYSTEM,
-        0,
+        DeviceToMount->Characteristics,
         FALSE,
         &NewDeviceObject);
     if (!NT_SUCCESS(Status))
         FALSE,
         &NewDeviceObject);
     if (!NT_SUCCESS(Status))
index d071632..0198335 100644 (file)
@@ -139,8 +139,12 @@ CdfsGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
 
 
 static NTSTATUS
 
 
 static NTSTATUS
-CdfsGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
-                           PULONG BufferLength)
+CdfsGetFsDeviceInformation
+(
+    PDEVICE_OBJECT DeviceObject,
+    PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
+    PULONG BufferLength
+)
 {
     DPRINT("CdfsGetFsDeviceInformation()\n");
     DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
 {
     DPRINT("CdfsGetFsDeviceInformation()\n");
     DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
@@ -151,7 +155,7 @@ CdfsGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
         return(STATUS_BUFFER_OVERFLOW);
 
     FsDeviceInfo->DeviceType = FILE_DEVICE_CD_ROM;
         return(STATUS_BUFFER_OVERFLOW);
 
     FsDeviceInfo->DeviceType = FILE_DEVICE_CD_ROM;
-    FsDeviceInfo->Characteristics = 0; /* FIXME: fix this !! */
+    FsDeviceInfo->Characteristics = DeviceObject->Characteristics;
 
     DPRINT("FsdGetFsDeviceInformation() finished.\n");
 
 
     DPRINT("FsdGetFsDeviceInformation() finished.\n");
 
@@ -203,7 +207,8 @@ CdfsQueryVolumeInformation(PDEVICE_OBJECT DeviceObject,
         break;
 
     case FileFsDeviceInformation:
         break;
 
     case FileFsDeviceInformation:
-        Status = CdfsGetFsDeviceInformation(SystemBuffer,
+        Status = CdfsGetFsDeviceInformation(DeviceObject,
+            SystemBuffer,
             &BufferLength);
         break;
 
             &BufferLength);
         break;
 
index b064619..8b47aa8 100644 (file)
@@ -425,7 +425,7 @@ VfatMount (PVFAT_IRP_CONTEXT IrpContext)
                            ROUND_UP(sizeof (DEVICE_EXTENSION), sizeof(ULONG)) + sizeof(HASHENTRY*) * HashTableSize,
                            NULL,
                            FILE_DEVICE_DISK_FILE_SYSTEM,
                            ROUND_UP(sizeof (DEVICE_EXTENSION), sizeof(ULONG)) + sizeof(HASHENTRY*) * HashTableSize,
                            NULL,
                            FILE_DEVICE_DISK_FILE_SYSTEM,
-                           0,
+                           DeviceToMount->Characteristics,
                            FALSE,
                            &DeviceObject);
    if (!NT_SUCCESS(Status))
                            FALSE,
                            &DeviceObject);
    if (!NT_SUCCESS(Status))
index 4bf4ffe..d91e44f 100644 (file)
@@ -129,8 +129,12 @@ FsdGetFsSizeInformation(PDEVICE_OBJECT DeviceObject,
 
 
 static NTSTATUS
 
 
 static NTSTATUS
-FsdGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
-                         PULONG BufferLength)
+FsdGetFsDeviceInformation
+(
+  PDEVICE_OBJECT DeviceObject,
+  PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
+  PULONG BufferLength
+)
 {
   DPRINT("FsdGetFsDeviceInformation()\n");
   DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
 {
   DPRINT("FsdGetFsDeviceInformation()\n");
   DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo);
@@ -141,7 +145,7 @@ FsdGetFsDeviceInformation(PFILE_FS_DEVICE_INFORMATION FsDeviceInfo,
     return(STATUS_BUFFER_OVERFLOW);
 
   FsDeviceInfo->DeviceType = FILE_DEVICE_DISK;
     return(STATUS_BUFFER_OVERFLOW);
 
   FsDeviceInfo->DeviceType = FILE_DEVICE_DISK;
-  FsDeviceInfo->Characteristics = 0; /* FIXME: fix this !! */
+  FsDeviceInfo->Characteristics = DeviceObject->Characteristics;
 
   DPRINT("FsdGetFsDeviceInformation() finished.\n");
 
 
   DPRINT("FsdGetFsDeviceInformation() finished.\n");
 
@@ -343,7 +347,8 @@ NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
       break;
 
     case FileFsDeviceInformation:
       break;
 
     case FileFsDeviceInformation:
-      RC = FsdGetFsDeviceInformation(SystemBuffer,
+      RC = FsdGetFsDeviceInformation(IrpContext->DeviceObject,
+                                    SystemBuffer,
                                     &BufferLength);
       break;
 
                                     &BufferLength);
       break;