[UDFS]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 3 Jun 2017 18:29:44 +0000 (18:29 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 3 Jun 2017 18:29:44 +0000 (18:29 +0000)
Our current storage stack iteration considers that any CDROM is read-only and forces it.
Reflect that fact in UDFS; we cannot assume that our device won't be readonly.

CORE-4375

svn path=/trunk/; revision=74781

reactos/drivers/filesystems/udfs/volinfo.cpp

index bf9ca46..5d6c045 100644 (file)
@@ -462,8 +462,15 @@ UDFQueryFsDeviceInfo(
 
     KdPrint(("  UDFQueryFsDeviceInfo: \n"));
     //  Update the output buffer.
-    ASSERT(! (Vcb->TargetDeviceObject->Characteristics & (FILE_READ_ONLY_DEVICE | FILE_WRITE_ONCE_MEDIA)));
-    Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics & ~(FILE_READ_ONLY_DEVICE | FILE_WRITE_ONCE_MEDIA);
+    if (Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_CD_ROM && Vcb->TargetDeviceObject->DeviceType != FILE_DEVICE_DVD)
+    {
+        ASSERT(! (Vcb->TargetDeviceObject->Characteristics & (FILE_READ_ONLY_DEVICE | FILE_WRITE_ONCE_MEDIA)));
+        Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics & ~(FILE_READ_ONLY_DEVICE | FILE_WRITE_ONCE_MEDIA);
+    }
+    else
+    {
+        Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;
+    }
     Buffer->DeviceType = Vcb->TargetDeviceObject->DeviceType;
     KdPrint(("    Characteristics %x, DeviceType %x\n", Buffer->Characteristics, Buffer->DeviceType));
     //  Adjust the length variable