From cf776e38c28a3fa9b747061e7f65e78f92950585 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Mon, 12 Jan 2009 17:04:13 +0000 Subject: [PATCH] - Stubplement handlers for all needed IRP_MJ except EA and PNP one. - Cleanup remains of unneeded functions. svn path=/trunk/; revision=38726 --- .../drivers/filesystems/fastfat_new/cleanup.c | 5 ++- .../drivers/filesystems/fastfat_new/close.c | 5 ++- .../drivers/filesystems/fastfat_new/create.c | 3 +- .../drivers/filesystems/fastfat_new/device.c | 23 ++++++++++ reactos/drivers/filesystems/fastfat_new/dir.c | 3 +- .../drivers/filesystems/fastfat_new/fastfat.c | 38 ++++++++-------- .../drivers/filesystems/fastfat_new/fastfat.h | 44 +++++++++++++------ .../filesystems/fastfat_new/fastfat.rbuild | 2 + .../drivers/filesystems/fastfat_new/finfo.c | 8 +++- .../drivers/filesystems/fastfat_new/flush.c | 11 ++--- .../drivers/filesystems/fastfat_new/fsctl.c | 5 ++- .../drivers/filesystems/fastfat_new/lock.c | 23 ++++++++++ reactos/drivers/filesystems/fastfat_new/rw.c | 6 ++- .../filesystems/fastfat_new/shutdown.c | 2 +- .../drivers/filesystems/fastfat_new/volume.c | 6 ++- 15 files changed, 129 insertions(+), 55 deletions(-) create mode 100644 reactos/drivers/filesystems/fastfat_new/device.c create mode 100644 reactos/drivers/filesystems/fastfat_new/lock.c diff --git a/reactos/drivers/filesystems/fastfat_new/cleanup.c b/reactos/drivers/filesystems/fastfat_new/cleanup.c index 802342c35d1..975bec80627 100644 --- a/reactos/drivers/filesystems/fastfat_new/cleanup.c +++ b/reactos/drivers/filesystems/fastfat_new/cleanup.c @@ -14,9 +14,10 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatCleanup(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT("VfatCleanup(DeviceObject %p, Irp %p)\n", IrpContext->DeviceObject, IrpContext->Irp); + DPRINT("FatCleanup(DeviceObject %p, Irp %p)\n", DeviceObject, Irp); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/close.c b/reactos/drivers/filesystems/fastfat_new/close.c index ed05f2df2d0..ce17a9804f8 100644 --- a/reactos/drivers/filesystems/fastfat_new/close.c +++ b/reactos/drivers/filesystems/fastfat_new/close.c @@ -14,9 +14,10 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatClose(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatClose(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT("VfatClose(DeviceObject %p, Irp %p)\n", IrpContext->DeviceObject, IrpContext->Irp); + DPRINT("FatClose(DeviceObject %p, Irp %p)\n", DeviceObject, Irp); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/create.c b/reactos/drivers/filesystems/fastfat_new/create.c index ac64e37413c..c4207fe153e 100644 --- a/reactos/drivers/filesystems/fastfat_new/create.c +++ b/reactos/drivers/filesystems/fastfat_new/create.c @@ -14,7 +14,8 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS -VfatCreate(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/device.c b/reactos/drivers/filesystems/fastfat_new/device.c new file mode 100644 index 00000000000..aa4930bcf01 --- /dev/null +++ b/reactos/drivers/filesystems/fastfat_new/device.c @@ -0,0 +1,23 @@ +/* + * PROJECT: ReactOS FAT file system driver + * LICENSE: GPL - See COPYING in the top level directory + * FILE: drivers/filesystems/fastfat/device.c + * PURPOSE: Device control + * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#define NDEBUG +#include "fastfat.h" + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS +NTAPI +FatDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + return STATUS_NOT_IMPLEMENTED; +} + +/* EOF */ diff --git a/reactos/drivers/filesystems/fastfat_new/dir.c b/reactos/drivers/filesystems/fastfat_new/dir.c index 3bff711cbb4..df8094656aa 100644 --- a/reactos/drivers/filesystems/fastfat_new/dir.c +++ b/reactos/drivers/filesystems/fastfat_new/dir.c @@ -14,7 +14,8 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS -VfatDirectoryControl(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatDirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/fastfat.c b/reactos/drivers/filesystems/fastfat_new/fastfat.c index babcca00cc6..ad48382c49c 100644 --- a/reactos/drivers/filesystems/fastfat_new/fastfat.c +++ b/reactos/drivers/filesystems/fastfat_new/fastfat.c @@ -42,25 +42,25 @@ DriverEntry(PDRIVER_OBJECT DriverObject, 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 + /* Fill major function handlers */ + DriverObject->MajorFunction[IRP_MJ_CLOSE] = FatClose; + DriverObject->MajorFunction[IRP_MJ_CREATE] = FatCreate; + DriverObject->MajorFunction[IRP_MJ_READ] = FatRead; + DriverObject->MajorFunction[IRP_MJ_WRITE] = FatWrite; + DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = FatFileSystemControl; + DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = FatQueryInformation; + DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = FatSetInformation; + DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = FatDirectoryControl; + DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = FatQueryVolumeInfo; + DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = FatSetVolumeInfo; + DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = FatShutdown; + DriverObject->MajorFunction[IRP_MJ_LOCK_CONTROL] = FatLockControl; + DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = FatDeviceControl; + DriverObject->MajorFunction[IRP_MJ_CLEANUP] = FatCleanup; + DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = FatFlushBuffers; + //DriverObject->MajorFunction[IRP_MJ_QUERY_EA] + //DriverObject->MajorFunction[IRP_MJ_SET_EA] + //DriverObject->MajorFunction[IRP_MJ_PNP] DriverObject->DriverUnload = NULL; diff --git a/reactos/drivers/filesystems/fastfat_new/fastfat.h b/reactos/drivers/filesystems/fastfat_new/fastfat.h index 35500798d2c..1732f8d168e 100644 --- a/reactos/drivers/filesystems/fastfat_new/fastfat.h +++ b/reactos/drivers/filesystems/fastfat_new/fastfat.h @@ -457,27 +457,33 @@ FatShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* -------------------------------------------------------- volume.c */ -NTSTATUS VfatQueryVolumeInformation (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatQueryVolumeInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp); -NTSTATUS VfatSetVolumeInformation (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatSetVolumeInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* ------------------------------------------------------ blockdev.c */ /* ----------------------------------------------------------- dir.c */ -NTSTATUS VfatDirectoryControl (PFAT_IRP_CONTEXT); +NTSTATUS NTAPI +FatDirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* -------------------------------------------------------- create.c */ -NTSTATUS VfatCreate (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* --------------------------------------------------------- close.c */ -NTSTATUS VfatClose (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatClose(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* ------------------------------------------------------- cleanup.c */ -NTSTATUS VfatCleanup (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* --------------------------------------------------------- fastio.c */ @@ -505,16 +511,20 @@ FatNoopAcquire(IN PVOID Context, VOID NTAPI FatNoopRelease(IN PVOID Context); +/* --------------------------------------------------------- lock.c */ + +NTSTATUS NTAPI +FatLockControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* --------------------------------------------------------- fsctl.c */ -NTSTATUS VfatFileSystemControl (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* --------------------------------------------------------- finfo.c */ -NTSTATUS VfatQueryInformation (PFAT_IRP_CONTEXT IrpContext); - -NTSTATUS VfatSetInformation (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI FatQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp); +NTSTATUS NTAPI FatSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* --------------------------------------------------------- iface.c */ @@ -524,19 +534,27 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath); /* ----------------------------------------------------------- fat.c */ +/* ------------------------------------------------------ device.c */ + +NTSTATUS NTAPI +FatDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp); + /* ------------------------------------------------------ direntry.c */ /* ----------------------------------------------------------- fcb.c */ /* ------------------------------------------------------------ rw.c */ -NTSTATUS VfatRead (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatRead(PDEVICE_OBJECT DeviceObject, PIRP Irp); -NTSTATUS VfatWrite (PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* ------------------------------------------------------------- flush.c */ -NTSTATUS VfatFlush(PFAT_IRP_CONTEXT IrpContext); +NTSTATUS NTAPI +FatFlushBuffers(PDEVICE_OBJECT DeviceObject, PIRP Irp); /* EOF */ diff --git a/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild b/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild index 9413b1efa65..df70afc7bf6 100644 --- a/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild +++ b/reactos/drivers/filesystems/fastfat_new/fastfat.rbuild @@ -9,6 +9,7 @@ cleanup.c close.c create.c + device.c dir.c direntry.c ea.c @@ -19,6 +20,7 @@ finfo.c flush.c fsctl.c + lock.c rw.c shutdown.c volume.c diff --git a/reactos/drivers/filesystems/fastfat_new/finfo.c b/reactos/drivers/filesystems/fastfat_new/finfo.c index 1c36d6071b3..bece57d6db4 100644 --- a/reactos/drivers/filesystems/fastfat_new/finfo.c +++ b/reactos/drivers/filesystems/fastfat_new/finfo.c @@ -13,12 +13,16 @@ /* FUNCTIONS ****************************************************************/ -NTSTATUS VfatQueryInformation(PFAT_IRP_CONTEXT IrpContext) +NTSTATUS +NTAPI +FatQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } -NTSTATUS VfatSetInformation(PFAT_IRP_CONTEXT IrpContext) +NTSTATUS +NTAPI +FatSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/flush.c b/reactos/drivers/filesystems/fastfat_new/flush.c index 2f42e019e93..43d5461e556 100644 --- a/reactos/drivers/filesystems/fastfat_new/flush.c +++ b/reactos/drivers/filesystems/fastfat_new/flush.c @@ -14,14 +14,9 @@ /* FUNCTIONS ****************************************************************/ -NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb) -{ - DPRINT("VfatFlushVolume(DeviceExt %p, FatFcb %p)\n", DeviceExt, VolumeFcb); - - return STATUS_NOT_IMPLEMENTED; -} - -NTSTATUS VfatFlush(PFAT_IRP_CONTEXT IrpContext) +NTSTATUS +NTAPI +FatFlushBuffers(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/fsctl.c b/reactos/drivers/filesystems/fastfat_new/fsctl.c index b1b624545fb..0ebefd08ac6 100644 --- a/reactos/drivers/filesystems/fastfat_new/fsctl.c +++ b/reactos/drivers/filesystems/fastfat_new/fsctl.c @@ -14,9 +14,10 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatFileSystemControl(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT("VfatFileSystemControl(IrpContext %p)\n", IrpContext); + DPRINT("VfatFileSystemControl(DeviceObject %p, Irp %p)\n", DeviceObject, Irp); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/lock.c b/reactos/drivers/filesystems/fastfat_new/lock.c new file mode 100644 index 00000000000..b67f0f8eb9b --- /dev/null +++ b/reactos/drivers/filesystems/fastfat_new/lock.c @@ -0,0 +1,23 @@ +/* + * PROJECT: ReactOS FAT file system driver + * LICENSE: GPL - See COPYING in the top level directory + * FILE: drivers/filesystems/fastfat/lock.c + * PURPOSE: Lock support routines + * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#define NDEBUG +#include "fastfat.h" + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS +NTAPI +FatLockControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + return STATUS_NOT_IMPLEMENTED; +} + +/* EOF */ diff --git a/reactos/drivers/filesystems/fastfat_new/rw.c b/reactos/drivers/filesystems/fastfat_new/rw.c index 53bc940ce88..dab1324b1c9 100644 --- a/reactos/drivers/filesystems/fastfat_new/rw.c +++ b/reactos/drivers/filesystems/fastfat_new/rw.c @@ -14,13 +14,15 @@ /* FUNCTIONS *****************************************************************/ NTSTATUS -VfatRead(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatRead(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } NTSTATUS -VfatWrite(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/shutdown.c b/reactos/drivers/filesystems/fastfat_new/shutdown.c index 3bb506d43ea..2dc3de06d12 100644 --- a/reactos/drivers/filesystems/fastfat_new/shutdown.c +++ b/reactos/drivers/filesystems/fastfat_new/shutdown.c @@ -17,7 +17,7 @@ NTSTATUS NTAPI FatShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp) { - DPRINT("VfatShutdown(DeviceObject %p, Irp %p)\n", DeviceObject, Irp); + DPRINT("FatShutdown(DeviceObject %p, Irp %p)\n", DeviceObject, Irp); return STATUS_NOT_IMPLEMENTED; } diff --git a/reactos/drivers/filesystems/fastfat_new/volume.c b/reactos/drivers/filesystems/fastfat_new/volume.c index 861ecfa8e2f..fc151676808 100644 --- a/reactos/drivers/filesystems/fastfat_new/volume.c +++ b/reactos/drivers/filesystems/fastfat_new/volume.c @@ -14,13 +14,15 @@ /* FUNCTIONS ****************************************************************/ NTSTATUS -VfatQueryVolumeInformation(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatQueryVolumeInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; } NTSTATUS -VfatSetVolumeInformation(PFAT_IRP_CONTEXT IrpContext) +NTAPI +FatSetVolumeInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp) { return STATUS_NOT_IMPLEMENTED; }