https://git.reactos.org/?p=reactos.git;a=commitdiff;h=67a7e45e351b70356fee4…
commit 67a7e45e351b70356fee442c31cb5de14a0de37e
Author: David Quintana <gigaherz(a)gmail.com>
AuthorDate: Fri Nov 24 19:55:23 2017 +0100
[CDFS_NEW] Address review comments:
- 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 | 2 +-
drivers/filesystems/cdfs_new/deviosup.c | 9 +++++++++
drivers/filesystems/cdfs_new/fsctrl.c | 5 +++++
drivers/filesystems/cdfs_new/shutdown.c | 4 ++++
media/doc/README.FSD | 6 ++++--
5 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/drivers/filesystems/cdfs_new/cdstruc.h
b/drivers/filesystems/cdfs_new/cdstruc.h
index 8a5c02d534..270cf9cf59 100755
--- a/drivers/filesystems/cdfs_new/cdstruc.h
+++ b/drivers/filesystems/cdfs_new/cdstruc.h
@@ -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 __volatile
+#define __volatile volatile
#define _Unreferenced_parameter_
#define __field_range(a,b)
#define __analysis_assert(x)
diff --git a/drivers/filesystems/cdfs_new/deviosup.c
b/drivers/filesystems/cdfs_new/deviosup.c
index a0bb2b7ffd..517a094a7e 100755
--- a/drivers/filesystems/cdfs_new/deviosup.c
+++ b/drivers/filesystems/cdfs_new/deviosup.c
@@ -2607,6 +2607,9 @@ Return Value:
// 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 );
@@ -2617,6 +2620,12 @@ Return Value:
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)) {
diff --git a/drivers/filesystems/cdfs_new/fsctrl.c
b/drivers/filesystems/cdfs_new/fsctrl.c
index 8e039ef54b..e330699fc3 100755
--- a/drivers/filesystems/cdfs_new/fsctrl.c
+++ b/drivers/filesystems/cdfs_new/fsctrl.c
@@ -1066,7 +1066,12 @@ Return Value:
//
if (!FlagOn( Vcb->VcbState, VCB_STATE_AUDIO_DISK) &&
+#ifndef __REACTOS__
((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;
diff --git a/drivers/filesystems/cdfs_new/shutdown.c
b/drivers/filesystems/cdfs_new/shutdown.c
index d6c70580a6..30d060cde3 100644
--- a/drivers/filesystems/cdfs_new/shutdown.c
+++ b/drivers/filesystems/cdfs_new/shutdown.c
@@ -167,6 +167,10 @@ Return Value:
IoUnregisterFileSystem( CdData.FileSystemDeviceObject );
IoDeleteDevice( CdData.FileSystemDeviceObject );
+#ifdef __REACTOS__
+ IoUnregisterFileSystem( CdData.HddFileSystemDeviceObject );
+ IoDeleteDevice( CdData.HddFileSystemDeviceObject );
+#endif
CdCompleteRequest( IrpContext, Irp, STATUS_SUCCESS );
return STATUS_SUCCESS;
diff --git a/media/doc/README.FSD b/media/doc/README.FSD
index 539a0c058d..681a4a0fd5 100644
--- a/media/doc/README.FSD
+++ b/media/doc/README.FSD
@@ -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
-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