From e7ad148a6c4918d126bbda90e051d22c1eb623c2 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 1 May 2015 18:38:10 +0000 Subject: [PATCH] [NTFS] Add FastIO non-support in NTFS svn path=/trunk/; revision=67501 --- reactos/drivers/filesystems/ntfs/fastio.c | 70 +++++++++++++++++++++++ reactos/drivers/filesystems/ntfs/ntfs.c | 6 ++ reactos/drivers/filesystems/ntfs/ntfs.h | 5 ++ 3 files changed, 81 insertions(+) diff --git a/reactos/drivers/filesystems/ntfs/fastio.c b/reactos/drivers/filesystems/ntfs/fastio.c index fc778336296..b936c8b7d35 100644 --- a/reactos/drivers/filesystems/ntfs/fastio.c +++ b/reactos/drivers/filesystems/ntfs/fastio.c @@ -75,4 +75,74 @@ NtfsRelReadAhead(PVOID Context) UNIMPLEMENTED; } +BOOLEAN +NTAPI +NtfsFastIoCheckIfPossible( + _In_ PFILE_OBJECT FileObject, + _In_ PLARGE_INTEGER FileOffset, + _In_ ULONG Length, + _In_ BOOLEAN Wait, + _In_ ULONG LockKey, + _In_ BOOLEAN CheckForReadOperation, + _Out_ PIO_STATUS_BLOCK IoStatus, + _In_ PDEVICE_OBJECT DeviceObject) +{ + /* Deny FastIo */ + UNREFERENCED_PARAMETER(FileObject); + UNREFERENCED_PARAMETER(FileOffset); + UNREFERENCED_PARAMETER(Length); + UNREFERENCED_PARAMETER(Wait); + UNREFERENCED_PARAMETER(LockKey); + UNREFERENCED_PARAMETER(CheckForReadOperation); + UNREFERENCED_PARAMETER(IoStatus); + UNREFERENCED_PARAMETER(DeviceObject); + return FALSE; +} + +BOOLEAN +NTAPI +NtfsFastIoRead( + _In_ PFILE_OBJECT FileObject, + _In_ PLARGE_INTEGER FileOffset, + _In_ ULONG Length, + _In_ BOOLEAN Wait, + _In_ ULONG LockKey, + _Out_ PVOID Buffer, + _Out_ PIO_STATUS_BLOCK IoStatus, + _In_ PDEVICE_OBJECT DeviceObject) +{ + DBG_UNREFERENCED_PARAMETER(FileObject); + DBG_UNREFERENCED_PARAMETER(FileOffset); + DBG_UNREFERENCED_PARAMETER(Length); + DBG_UNREFERENCED_PARAMETER(Wait); + DBG_UNREFERENCED_PARAMETER(LockKey); + DBG_UNREFERENCED_PARAMETER(Buffer); + DBG_UNREFERENCED_PARAMETER(IoStatus); + DBG_UNREFERENCED_PARAMETER(DeviceObject); + return FALSE; +} + +BOOLEAN +NTAPI +NtfsFastIoWrite( + _In_ PFILE_OBJECT FileObject, + _In_ PLARGE_INTEGER FileOffset, + _In_ ULONG Length, + _In_ BOOLEAN Wait, + _In_ ULONG LockKey, + _In_ PVOID Buffer, + _Out_ PIO_STATUS_BLOCK IoStatus, + _In_ PDEVICE_OBJECT DeviceObject) +{ + DBG_UNREFERENCED_PARAMETER(FileObject); + DBG_UNREFERENCED_PARAMETER(FileOffset); + DBG_UNREFERENCED_PARAMETER(Length); + DBG_UNREFERENCED_PARAMETER(Wait); + DBG_UNREFERENCED_PARAMETER(LockKey); + DBG_UNREFERENCED_PARAMETER(Buffer); + DBG_UNREFERENCED_PARAMETER(IoStatus); + DBG_UNREFERENCED_PARAMETER(DeviceObject); + return FALSE; +} + /* EOF */ diff --git a/reactos/drivers/filesystems/ntfs/ntfs.c b/reactos/drivers/filesystems/ntfs/ntfs.c index 090ee68c22f..324b5b91439 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.c +++ b/reactos/drivers/filesystems/ntfs/ntfs.c @@ -80,6 +80,12 @@ DriverEntry(PDRIVER_OBJECT DriverObject, NtfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead = NtfsAcqReadAhead; NtfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = NtfsRelReadAhead; + NtfsGlobalData->FastIoDispatch.SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH); + NtfsGlobalData->FastIoDispatch.FastIoCheckIfPossible = NtfsFastIoCheckIfPossible; + NtfsGlobalData->FastIoDispatch.FastIoRead = NtfsFastIoRead; + NtfsGlobalData->FastIoDispatch.FastIoWrite = NtfsFastIoWrite; + DriverObject->FastIoDispatch = &NtfsGlobalData->FastIoDispatch; + /* Driver can't be unloaded */ DriverObject->DriverUnload = NULL; diff --git a/reactos/drivers/filesystems/ntfs/ntfs.h b/reactos/drivers/filesystems/ntfs/ntfs.h index 44b8874706e..5efb1e97fef 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.h +++ b/reactos/drivers/filesystems/ntfs/ntfs.h @@ -136,6 +136,7 @@ typedef struct PDEVICE_OBJECT DeviceObject; CACHE_MANAGER_CALLBACKS CacheMgrCallbacks; ULONG Flags; + FAST_IO_DISPATCH FastIoDispatch; } NTFS_GLOBAL_DATA, *PNTFS_GLOBAL_DATA; @@ -566,6 +567,10 @@ NtfsAcqReadAhead(PVOID Context, VOID NTAPI NtfsRelReadAhead(PVOID Context); +FAST_IO_CHECK_IF_POSSIBLE NtfsFastIoCheckIfPossible; +FAST_IO_READ NtfsFastIoRead; +FAST_IO_WRITE NtfsFastIoWrite; + /* fcb.c */