From a2c47e5c86879abef78170a8c1a71a1ee1bd89c0 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Sun, 11 Jan 2009 15:58:57 +0000 Subject: [PATCH] - Rewrite DriverEntry. - Start cleaning up structures. svn path=/trunk/; revision=38700 --- .../filesystems/fastfat_new/blockdev.c | 4 +- .../drivers/filesystems/fastfat_new/cleanup.c | 2 +- .../drivers/filesystems/fastfat_new/close.c | 2 +- .../drivers/filesystems/fastfat_new/create.c | 2 +- reactos/drivers/filesystems/fastfat_new/dir.c | 2 +- .../drivers/filesystems/fastfat_new/fastfat.c | 186 ++++++++---------- .../drivers/filesystems/fastfat_new/fastfat.h | 76 +++---- .../drivers/filesystems/fastfat_new/fastio.c | 37 +++- .../drivers/filesystems/fastfat_new/finfo.c | 4 +- .../drivers/filesystems/fastfat_new/flush.c | 2 +- .../drivers/filesystems/fastfat_new/fsctl.c | 2 +- reactos/drivers/filesystems/fastfat_new/rw.c | 4 +- .../drivers/filesystems/fastfat_new/volume.c | 4 +- 13 files changed, 168 insertions(+), 159 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat_new/blockdev.c b/reactos/drivers/filesystems/fastfat_new/blockdev.c index 06727c3d1b1..14ae7ae9f45 100644 --- a/reactos/drivers/filesystems/fastfat_new/blockdev.c +++ b/reactos/drivers/filesystems/fastfat_new/blockdev.c @@ -24,7 +24,7 @@ VfatReadDisk (IN PDEVICE_OBJECT pDeviceObject, } NTSTATUS -VfatReadDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext, +VfatReadDiskPartial (IN PFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, ULONG BufferOffset, @@ -35,7 +35,7 @@ VfatReadDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext, NTSTATUS -VfatWriteDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext, +VfatWriteDiskPartial (IN PFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN ULONG BufferOffset, diff --git a/reactos/drivers/filesystems/fastfat_new/cleanup.c b/reactos/drivers/filesystems/fastfat_new/cleanup.c index ea38be0a6f7..802342c35d1 100644 --- a/reactos/drivers/filesystems/fastfat_new/cleanup.c +++ b/reactos/drivers/filesystems/fastfat_new/cleanup.c @@ -14,7 +14,7 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatCleanup(PVFAT_IRP_CONTEXT IrpContext) +VfatCleanup(PFAT_IRP_CONTEXT IrpContext) { DPRINT("VfatCleanup(DeviceObject %p, Irp %p)\n", IrpContext->DeviceObject, IrpContext->Irp); diff --git a/reactos/drivers/filesystems/fastfat_new/close.c b/reactos/drivers/filesystems/fastfat_new/close.c index 21df0853955..ed05f2df2d0 100644 --- a/reactos/drivers/filesystems/fastfat_new/close.c +++ b/reactos/drivers/filesystems/fastfat_new/close.c @@ -14,7 +14,7 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatClose(PVFAT_IRP_CONTEXT IrpContext) +VfatClose(PFAT_IRP_CONTEXT IrpContext) { DPRINT("VfatClose(DeviceObject %p, Irp %p)\n", IrpContext->DeviceObject, IrpContext->Irp); diff --git a/reactos/drivers/filesystems/fastfat_new/create.c b/reactos/drivers/filesystems/fastfat_new/create.c index cd55873b0bc..ac64e37413c 100644 --- a/reactos/drivers/filesystems/fastfat_new/create.c +++ b/reactos/drivers/filesystems/fastfat_new/create.c @@ -14,7 +14,7 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS -VfatCreate(PVFAT_IRP_CONTEXT IrpContext) +VfatCreate(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/dir.c b/reactos/drivers/filesystems/fastfat_new/dir.c index 5a5f9a98b12..3bff711cbb4 100644 --- a/reactos/drivers/filesystems/fastfat_new/dir.c +++ b/reactos/drivers/filesystems/fastfat_new/dir.c @@ -14,7 +14,7 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS -VfatDirectoryControl(PVFAT_IRP_CONTEXT IrpContext) +VfatDirectoryControl(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/fastfat.c b/reactos/drivers/filesystems/fastfat_new/fastfat.c index 2bee026794e..315e25e7781 100644 --- a/reactos/drivers/filesystems/fastfat_new/fastfat.c +++ b/reactos/drivers/filesystems/fastfat_new/fastfat.c @@ -1,26 +1,9 @@ /* - * ReactOS kernel - * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* - * PROJECT: ReactOS kernel - * FILE: drivers/fs/vfat/iface.c - * PURPOSE: VFAT Filesystem - * PROGRAMMER: Jason Filby (jasonfilby@yahoo.com) + * PROJECT: ReactOS FAT file system driver + * LICENSE: GPL - See COPYING in the top level directory + * FILE: drivers/filesystems/fastfat/fastfat.c + * PURPOSE: Initialization routines + * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org) */ /* INCLUDES *****************************************************************/ @@ -28,103 +11,104 @@ #define NDEBUG #include "fastfat.h" -/* GLOBALS *****************************************************************/ +/* GLOBALS ******************************************************************/ -PVFAT_GLOBAL_DATA VfatGlobalData; +FAT_GLOBAL_DATA FatGlobalData; /* FUNCTIONS ****************************************************************/ -NTSTATUS NTAPI +NTSTATUS +NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath) -/* - * FUNCTION: Called by the system to initialize the driver - * ARGUMENTS: - * DriverObject = object describing this driver - * RegistryPath = path to our configuration entries - * RETURNS: Success or failure - */ + PUNICODE_STRING RegistryPath) { - PDEVICE_OBJECT DeviceObject; - UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Fat"); - NTSTATUS Status; + PDEVICE_OBJECT DeviceObject; + UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Fat"); + NTSTATUS Status; - Status = IoCreateDevice(DriverObject, - sizeof(VFAT_GLOBAL_DATA), - &DeviceName, - FILE_DEVICE_DISK_FILE_SYSTEM, - 0, - FALSE, - &DeviceObject); + /* Create a device object */ + Status = IoCreateDevice(DriverObject, + 0, + &DeviceName, + FILE_DEVICE_DISK_FILE_SYSTEM, + 0, + FALSE, + &DeviceObject); - if (Status == STATUS_OBJECT_NAME_EXISTS || - Status == STATUS_OBJECT_NAME_COLLISION) - { - /* Try an other name, if 'Fat' is already in use. 'Fat' is also used by fastfat.sys on W2K */ - RtlInitUnicodeString(&DeviceName, L"\\RosFat"); - Status = IoCreateDevice(DriverObject, - sizeof(VFAT_GLOBAL_DATA), - &DeviceName, - FILE_DEVICE_DISK_FILE_SYSTEM, - 0, - FALSE, - &DeviceObject); - } + if (!NT_SUCCESS(Status)) return Status; + /* Zero global storage */ + RtlZeroMemory(&FatGlobalData, sizeof(FAT_GLOBAL_DATA)); + FatGlobalData.DriverObject = DriverObject; + FatGlobalData.DiskDeviceObject = DeviceObject; + // TODO: Fill major function handlers +#if 0 + DriverObject->MajorFunction[IRP_MJ_CLOSE] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_CREATE] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_READ] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_WRITE] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = + VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = + VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = VfatShutdown; + DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_CLEANUP] = VfatBuildRequest; + DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = VfatBuildRequest; +#endif - if (!NT_SUCCESS(Status)) - { - return (Status); - } + DriverObject->DriverUnload = NULL; - VfatGlobalData = DeviceObject->DeviceExtension; - RtlZeroMemory (VfatGlobalData, sizeof(VFAT_GLOBAL_DATA)); - VfatGlobalData->DriverObject = DriverObject; - VfatGlobalData->DeviceObject = DeviceObject; + /* Initialize cache manager callbacks */ + FatGlobalData.CacheMgrCallbacks.AcquireForLazyWrite = FatAcquireForLazyWrite; + FatGlobalData.CacheMgrCallbacks.ReleaseFromLazyWrite = FatReleaseFromLazyWrite; + FatGlobalData.CacheMgrCallbacks.AcquireForReadAhead = FatAcquireForReadAhead; + FatGlobalData.CacheMgrCallbacks.ReleaseFromReadAhead = FatReleaseFromReadAhead; - DeviceObject->Flags |= DO_DIRECT_IO; - /*DriverObject->MajorFunction[IRP_MJ_CLOSE] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_CREATE] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_READ] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_WRITE] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = - VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = - VfatBuildRequest;*/ - DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = VfatShutdown; - /*DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_CLEANUP] = VfatBuildRequest; - DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = VfatBuildRequest;*/ + FatGlobalData.CacheMgrCallbacks.AcquireForLazyWrite = FatNoopAcquire; + FatGlobalData.CacheMgrCallbacks.ReleaseFromLazyWrite = FatNoopRelease; + FatGlobalData.CacheMgrCallbacks.AcquireForReadAhead = FatNoopAcquire; + FatGlobalData.CacheMgrCallbacks.ReleaseFromReadAhead = FatNoopRelease; - DriverObject->DriverUnload = NULL; + /* Initialize Fast I/O dispatchers */ + FatInitFastIoRoutines(&FatGlobalData.FastIoDispatch); + DriverObject->FastIoDispatch = &FatGlobalData.FastIoDispatch; - /* Cache manager */ - VfatGlobalData->CacheMgrCallbacks.AcquireForLazyWrite = VfatAcquireForLazyWrite; - VfatGlobalData->CacheMgrCallbacks.ReleaseFromLazyWrite = VfatReleaseFromLazyWrite; - VfatGlobalData->CacheMgrCallbacks.AcquireForReadAhead = VfatAcquireForReadAhead; - VfatGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = VfatReleaseFromReadAhead; + /* Initialize lookaside lists */ + ExInitializeNPagedLookasideList(&FatGlobalData.NonPagedFcbList, + NULL, + NULL, + 0, + sizeof(VFATFCB), + TAG_FCB, + 0); - /* Fast I/O */ - VfatInitFastIoRoutines(&VfatGlobalData->FastIoDispatch); - DriverObject->FastIoDispatch = &VfatGlobalData->FastIoDispatch; + ExInitializeNPagedLookasideList(&FatGlobalData.ResourceList, + NULL, + NULL, + 0, + sizeof(ERESOURCE), + TAG_CCB, + 0); - /* Private lists */ - ExInitializeNPagedLookasideList(&VfatGlobalData->FcbLookasideList, - NULL, NULL, 0, sizeof(VFATFCB), TAG_FCB, 0); - ExInitializeNPagedLookasideList(&VfatGlobalData->CcbLookasideList, - NULL, NULL, 0, sizeof(VFATCCB), TAG_CCB, 0); - ExInitializeNPagedLookasideList(&VfatGlobalData->IrpContextLookasideList, - NULL, NULL, 0, sizeof(VFAT_IRP_CONTEXT), TAG_IRP, 0); + ExInitializeNPagedLookasideList(&FatGlobalData.IrpContextList, + NULL, + NULL, + 0, + sizeof(FAT_IRP_CONTEXT), + TAG_IRP, + 0); - ExInitializeResourceLite(&VfatGlobalData->VolumeListLock); - InitializeListHead(&VfatGlobalData->VolumeListHead); - IoRegisterFileSystem(DeviceObject); - return(STATUS_SUCCESS); + /* Register and reference our filesystem */ + IoRegisterFileSystem(DeviceObject); + ObReferenceObject(DeviceObject); + + return STATUS_SUCCESS; } /* EOF */ diff --git a/reactos/drivers/filesystems/fastfat_new/fastfat.h b/reactos/drivers/filesystems/fastfat_new/fastfat.h index 43f222b680c..fc55b1bc9e6 100644 --- a/reactos/drivers/filesystems/fastfat_new/fastfat.h +++ b/reactos/drivers/filesystems/fastfat_new/fastfat.h @@ -296,19 +296,17 @@ typedef struct DEVICE_EXTENSION typedef struct { - PDRIVER_OBJECT DriverObject; - PDEVICE_OBJECT DeviceObject; - ULONG Flags; - ERESOURCE VolumeListLock; - LIST_ENTRY VolumeListHead; - NPAGED_LOOKASIDE_LIST FcbLookasideList; - NPAGED_LOOKASIDE_LIST CcbLookasideList; - NPAGED_LOOKASIDE_LIST IrpContextLookasideList; - FAST_IO_DISPATCH FastIoDispatch; - CACHE_MANAGER_CALLBACKS CacheMgrCallbacks; -} VFAT_GLOBAL_DATA, *PVFAT_GLOBAL_DATA; + PDRIVER_OBJECT DriverObject; + PDEVICE_OBJECT DiskDeviceObject; + NPAGED_LOOKASIDE_LIST NonPagedFcbList; + NPAGED_LOOKASIDE_LIST ResourceList; + NPAGED_LOOKASIDE_LIST IrpContextList; + FAST_IO_DISPATCH FastIoDispatch; + CACHE_MANAGER_CALLBACKS CacheMgrCallbacks; + CACHE_MANAGER_CALLBACKS CacheMgrNoopCallbacks; +} FAT_GLOBAL_DATA, *VFAT_GLOBAL_DATA; -extern PVFAT_GLOBAL_DATA VfatGlobalData; +extern VFAT_GLOBAL_DATA VfatGlobalData; #define FCB_CACHE_INITIALIZED 0x0001 #define FCB_DELETE_PENDING 0x0002 @@ -449,7 +447,7 @@ typedef struct PFILE_OBJECT FileObject; ULONG RefCount; KEVENT Event; -} VFAT_IRP_CONTEXT, *PVFAT_IRP_CONTEXT; +} FAT_IRP_CONTEXT, *PFAT_IRP_CONTEXT; typedef struct _VFAT_DIRENTRY_CONTEXT { @@ -469,9 +467,9 @@ NTSTATUS NTAPI VfatShutdown (PDEVICE_OBJECT DeviceObject, /* -------------------------------------------------------- volume.c */ -NTSTATUS VfatQueryVolumeInformation (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatQueryVolumeInformation (PFAT_IRP_CONTEXT IrpContext); -NTSTATUS VfatSetVolumeInformation (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatSetVolumeInformation (PFAT_IRP_CONTEXT IrpContext); /* ------------------------------------------------------ blockdev.c */ @@ -481,13 +479,13 @@ NTSTATUS VfatReadDisk(IN PDEVICE_OBJECT pDeviceObject, IN PUCHAR Buffer, IN BOOLEAN Override); -NTSTATUS VfatReadDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext, +NTSTATUS VfatReadDiskPartial (IN PFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, IN ULONG BufferOffset, IN BOOLEAN Wait); -NTSTATUS VfatWriteDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, +NTSTATUS VfatWriteDiskPartial(IN PFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN ULONG BufferOffset, @@ -503,7 +501,7 @@ NTSTATUS VfatBlockDeviceIoControl (IN PDEVICE_OBJECT DeviceObject, /* ----------------------------------------------------------- dir.c */ -NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT); +NTSTATUS VfatDirectoryControl (PFAT_IRP_CONTEXT); BOOLEAN FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt, USHORT DosDate, @@ -517,7 +515,7 @@ BOOLEAN FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt, /* -------------------------------------------------------- create.c */ -NTSTATUS VfatCreate (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatCreate (PFAT_IRP_CONTEXT IrpContext); NTSTATUS FindFile (PDEVICE_EXTENSION DeviceExt, PVFATFCB Parent, @@ -533,43 +531,51 @@ NTSTATUS ReadVolumeLabel(PDEVICE_EXTENSION DeviceExt, /* --------------------------------------------------------- close.c */ -NTSTATUS VfatClose (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatClose (PFAT_IRP_CONTEXT IrpContext); NTSTATUS VfatCloseFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject); /* ------------------------------------------------------- cleanup.c */ -NTSTATUS VfatCleanup (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatCleanup (PFAT_IRP_CONTEXT IrpContext); /* --------------------------------------------------------- fastio.c */ VOID -VfatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch); +FatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch); BOOLEAN NTAPI -VfatAcquireForLazyWrite(IN PVOID Context, +FatAcquireForLazyWrite(IN PVOID Context, IN BOOLEAN Wait); VOID NTAPI -VfatReleaseFromLazyWrite(IN PVOID Context); +FatReleaseFromLazyWrite(IN PVOID Context); BOOLEAN NTAPI -VfatAcquireForReadAhead(IN PVOID Context, +FatAcquireForReadAhead(IN PVOID Context, IN BOOLEAN Wait); VOID NTAPI -VfatReleaseFromReadAhead(IN PVOID Context); +FatReleaseFromReadAhead(IN PVOID Context); + +BOOLEAN NTAPI +FatNoopAcquire(IN PVOID Context, + IN BOOLEAN Wait); + +VOID NTAPI +FatNoopRelease(IN PVOID Context); + /* --------------------------------------------------------- fsctl.c */ -NTSTATUS VfatFileSystemControl (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatFileSystemControl (PFAT_IRP_CONTEXT IrpContext); /* --------------------------------------------------------- finfo.c */ -NTSTATUS VfatQueryInformation (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatQueryInformation (PFAT_IRP_CONTEXT IrpContext); -NTSTATUS VfatSetInformation (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatSetInformation (PFAT_IRP_CONTEXT IrpContext); NTSTATUS VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, @@ -745,9 +751,9 @@ NTSTATUS vfatMakeFCBFromDirEntry (PVCB vcb, /* ------------------------------------------------------------ rw.c */ -NTSTATUS VfatRead (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatRead (PFAT_IRP_CONTEXT IrpContext); -NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatWrite (PFAT_IRP_CONTEXT IrpContext); NTSTATUS NextCluster(PDEVICE_EXTENSION DeviceExt, ULONG FirstCluster, @@ -756,12 +762,12 @@ NTSTATUS NextCluster(PDEVICE_EXTENSION DeviceExt, /* ----------------------------------------------------------- misc.c */ -NTSTATUS VfatQueueRequest(PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatQueueRequest(PFAT_IRP_CONTEXT IrpContext); -PVFAT_IRP_CONTEXT VfatAllocateIrpContext(PDEVICE_OBJECT DeviceObject, +PFAT_IRP_CONTEXT VfatAllocateIrpContext(PDEVICE_OBJECT DeviceObject, PIRP Irp); -VOID VfatFreeIrpContext(PVFAT_IRP_CONTEXT IrpContext); +VOID VfatFreeIrpContext(PFAT_IRP_CONTEXT IrpContext); DRIVER_DISPATCH VfatBuildRequest; NTSTATUS NTAPI VfatBuildRequest (PDEVICE_OBJECT DeviceObject, @@ -778,7 +784,7 @@ VfatSetExtendedAttributes(PFILE_OBJECT FileObject, ULONG EaLength); /* ------------------------------------------------------------- flush.c */ -NTSTATUS VfatFlush(PVFAT_IRP_CONTEXT IrpContext); +NTSTATUS VfatFlush(PFAT_IRP_CONTEXT IrpContext); NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb); diff --git a/reactos/drivers/filesystems/fastfat_new/fastio.c b/reactos/drivers/filesystems/fastfat_new/fastio.c index 96930c4eae7..c7d3d552502 100644 --- a/reactos/drivers/filesystems/fastfat_new/fastio.c +++ b/reactos/drivers/filesystems/fastfat_new/fastio.c @@ -326,8 +326,9 @@ VfatReleaseForCcFlush(IN PFILE_OBJECT FileObject, return STATUS_SUCCESS; } -BOOLEAN NTAPI -VfatAcquireForLazyWrite(IN PVOID Context, +BOOLEAN +NTAPI +FatAcquireForLazyWrite(IN PVOID Context, IN BOOLEAN Wait) { PVFATFCB Fcb = (PVFATFCB)Context; @@ -342,8 +343,9 @@ VfatAcquireForLazyWrite(IN PVOID Context, return TRUE; } -VOID NTAPI -VfatReleaseFromLazyWrite(IN PVOID Context) +VOID +NTAPI +FatReleaseFromLazyWrite(IN PVOID Context) { PVFATFCB Fcb = (PVFATFCB)Context; ASSERT(Fcb); @@ -352,8 +354,9 @@ VfatReleaseFromLazyWrite(IN PVOID Context) ExReleaseResourceLite(&(Fcb->MainResource)); } -BOOLEAN NTAPI -VfatAcquireForReadAhead(IN PVOID Context, +BOOLEAN +NTAPI +FatAcquireForReadAhead(IN PVOID Context, IN BOOLEAN Wait) { PVFATFCB Fcb = (PVFATFCB)Context; @@ -368,8 +371,9 @@ VfatAcquireForReadAhead(IN PVOID Context, return TRUE; } -VOID NTAPI -VfatReleaseFromReadAhead(IN PVOID Context) +VOID +NTAPI +FatReleaseFromReadAhead(IN PVOID Context) { PVFATFCB Fcb = (PVFATFCB)Context; ASSERT(Fcb); @@ -378,8 +382,23 @@ VfatReleaseFromReadAhead(IN PVOID Context) ExReleaseResourceLite(&(Fcb->MainResource)); } +BOOLEAN +NTAPI +FatNoopAcquire(IN PVOID Context, + IN BOOLEAN Wait) +{ + return TRUE; +} + VOID -VfatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch) +NTAPI +FatNoopRelease(IN PVOID Context) +{ +} + + +VOID +FatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch) { FastIoDispatch->SizeOfFastIoDispatch = sizeof(FAST_IO_DISPATCH); FastIoDispatch->FastIoCheckIfPossible = VfatFastIoCheckIfPossible; diff --git a/reactos/drivers/filesystems/fastfat_new/finfo.c b/reactos/drivers/filesystems/fastfat_new/finfo.c index f4e33a746fc..1c36d6071b3 100644 --- a/reactos/drivers/filesystems/fastfat_new/finfo.c +++ b/reactos/drivers/filesystems/fastfat_new/finfo.c @@ -13,12 +13,12 @@ /* FUNCTIONS ****************************************************************/ -NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext) +NTSTATUS VfatQueryInformation(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } -NTSTATUS VfatSetInformation(PVFAT_IRP_CONTEXT IrpContext) +NTSTATUS VfatSetInformation(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/flush.c b/reactos/drivers/filesystems/fastfat_new/flush.c index 26955754603..2f42e019e93 100644 --- a/reactos/drivers/filesystems/fastfat_new/flush.c +++ b/reactos/drivers/filesystems/fastfat_new/flush.c @@ -21,7 +21,7 @@ NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb) return STATUS_NOT_IMPLEMENTED; } -NTSTATUS VfatFlush(PVFAT_IRP_CONTEXT IrpContext) +NTSTATUS VfatFlush(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/fsctl.c b/reactos/drivers/filesystems/fastfat_new/fsctl.c index 8017d3438c9..b1b624545fb 100644 --- a/reactos/drivers/filesystems/fastfat_new/fsctl.c +++ b/reactos/drivers/filesystems/fastfat_new/fsctl.c @@ -14,7 +14,7 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatFileSystemControl(PVFAT_IRP_CONTEXT IrpContext) +VfatFileSystemControl(PFAT_IRP_CONTEXT IrpContext) { DPRINT("VfatFileSystemControl(IrpContext %p)\n", IrpContext); diff --git a/reactos/drivers/filesystems/fastfat_new/rw.c b/reactos/drivers/filesystems/fastfat_new/rw.c index 80c2b28062c..53bc940ce88 100644 --- a/reactos/drivers/filesystems/fastfat_new/rw.c +++ b/reactos/drivers/filesystems/fastfat_new/rw.c @@ -14,13 +14,13 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS -VfatRead(PVFAT_IRP_CONTEXT IrpContext) +VfatRead(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } NTSTATUS -VfatWrite(PVFAT_IRP_CONTEXT IrpContext) +VfatWrite(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/volume.c b/reactos/drivers/filesystems/fastfat_new/volume.c index eaef222d3cf..861ecfa8e2f 100644 --- a/reactos/drivers/filesystems/fastfat_new/volume.c +++ b/reactos/drivers/filesystems/fastfat_new/volume.c @@ -14,13 +14,13 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext) +VfatQueryVolumeInformation(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; } NTSTATUS -VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext) +VfatSetVolumeInformation(PFAT_IRP_CONTEXT IrpContext) { return STATUS_NOT_IMPLEMENTED; }