[CDFS_NEW] Address review comments:
authorDavid Quintana <gigaherz@gmail.com>
Fri, 24 Nov 2017 18:55:23 +0000 (19:55 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 25 Nov 2017 12:36:47 +0000 (13:36 +0100)
- Don't define-out volatile.
- Cleanup the ros-specific hdd-backed device object on shutdown.
- Fix hdd-backed use. Required a rather ugly hack.
- Update README.FSD

drivers/filesystems/cdfs_new/cdstruc.h
drivers/filesystems/cdfs_new/deviosup.c
drivers/filesystems/cdfs_new/fsctrl.c
drivers/filesystems/cdfs_new/shutdown.c
media/doc/README.FSD

index 8a5c02d..270cf9c 100755 (executable)
@@ -171,7 +171,7 @@ typedef PVOID PBCB;     //**** Bcb's are now part of the cache module
 #define BYTE_COUNT_EMBEDDED_NAME        (32)
 
 #ifdef __REACTOS__
 #define BYTE_COUNT_EMBEDDED_NAME        (32)
 
 #ifdef __REACTOS__
-#define __volatile
+#define __volatile volatile
 #define _Unreferenced_parameter_
 #define __field_range(a,b)
 #define __analysis_assert(x)
 #define _Unreferenced_parameter_
 #define __field_range(a,b)
 #define __analysis_assert(x)
index a0bb2b7..517a094 100755 (executable)
@@ -2607,6 +2607,9 @@ Return Value:
             //  Make sure we don't try and read past end of the last track.
             //
 
             //  Make sure we don't try and read past end of the last track.
             //
 
+#ifdef __REACTOS__
+            if (Vcb->CdromToc) {
+#endif
             TrackData = &Vcb->CdromToc->TrackData[(Vcb->CdromToc->LastTrack - Vcb->CdromToc->FirstTrack + 1)];
 
             SwapCopyUchar4( &EndBlock, &TrackData->Address );
             TrackData = &Vcb->CdromToc->TrackData[(Vcb->CdromToc->LastTrack - Vcb->CdromToc->FirstTrack + 1)];
 
             SwapCopyUchar4( &EndBlock, &TrackData->Address );
@@ -2617,6 +2620,12 @@ Return Value:
 
                 Blocks = CD_SEC_CHUNK_BLOCKS;
             }
 
                 Blocks = CD_SEC_CHUNK_BLOCKS;
             }
+#ifdef __REACTOS__
+            } else {
+                // HACK!!!!!!!! Might cause reads to overrun the end of the partition, no idea what consequences that can have.
+                Blocks = CD_SEC_CHUNK_BLOCKS;
+            }
+#endif
 
             if ((0 == Blocks) || (Lbn < 16)) {
 
 
             if ((0 == Blocks) || (Lbn < 16)) {
 
index 8e039ef..e330699 100755 (executable)
@@ -1066,7 +1066,12 @@ Return Value:
         //
 
         if (!FlagOn( Vcb->VcbState, VCB_STATE_AUDIO_DISK) &&
         //
 
         if (!FlagOn( Vcb->VcbState, VCB_STATE_AUDIO_DISK) &&
+#ifndef __REACTOS__
             ((Vcb->CdromToc->LastTrack - Vcb->CdromToc->FirstTrack) == 0)) {
             ((Vcb->CdromToc->LastTrack - Vcb->CdromToc->FirstTrack) == 0)) {
+#else
+           ((FilesystemDeviceType == FILE_DEVICE_DISK_FILE_SYSTEM) ||
+            ((Vcb->CdromToc->LastTrack - Vcb->CdromToc->FirstTrack) == 0))) {
+#endif
 
             ULONG Index;
             PUCHAR Buffer;
 
             ULONG Index;
             PUCHAR Buffer;
index d6c7058..30d060c 100644 (file)
@@ -167,6 +167,10 @@ Return Value:
 
     IoUnregisterFileSystem( CdData.FileSystemDeviceObject );
     IoDeleteDevice( CdData.FileSystemDeviceObject );
 
     IoUnregisterFileSystem( CdData.FileSystemDeviceObject );
     IoDeleteDevice( CdData.FileSystemDeviceObject );
+#ifdef __REACTOS__
+    IoUnregisterFileSystem( CdData.HddFileSystemDeviceObject );
+    IoDeleteDevice( CdData.HddFileSystemDeviceObject );
+#endif
 
     CdCompleteRequest( IrpContext, Irp, STATUS_SUCCESS );
     return STATUS_SUCCESS;
 
     CdCompleteRequest( IrpContext, Irp, STATUS_SUCCESS );
     return STATUS_SUCCESS;
index 539a0c0..681a4a0 100644 (file)
@@ -16,5 +16,7 @@ The following FSD are shared with: http://www.acc.umu.se/~bosse/
 reactos/drivers/filesystems/ffs             # Synced to 0.5.2
 reactos/drivers/filesystems/reiserfs        # Synced to 0.26
 
 reactos/drivers/filesystems/ffs             # Synced to 0.5.2
 reactos/drivers/filesystems/reiserfs        # Synced to 0.26
 
-The following FSD are shared with: https://github.com/Microsoft/Windows-driver-samples.
-reactos/drivers/filesystems/fastfat_new    # Synced to 2817004
+The following FSD are shared with: https://github.com/Microsoft/Windows-driver-samples
+
+reactos/drivers/filesystems/fastfat_new     # Synced to 2817004
+reactos/drivers/filesystems/cdfs_new        # Synced to 2817004