Author: fireball
Date: Wed Jan 14 04:42:56 2009
New Revision: 38755
URL:
http://svn.reactos.org/svn/reactos?rev=38755&view=rev
Log:
- Add stubs for VolumeControlBlock structure, VolumeDeviceObject,
- Improve FAT_IRP_CONTEXT structure to suit future needs.
- Some more cleanup of fastfat.h (to be separated into a few headers as shown by Alex
Vlasov).
- Implement FatBuildIrpContext / FatDestroyIrpContext.
- Implement FatCompleteRequest.
- Implement dispatching of FSCTRL requests.
- DPRINT->DPRINT1 for all unimplemented functions.
- We receive a mount volume request!
Modified:
trunk/reactos/drivers/filesystems/fastfat_new/cleanup.c
trunk/reactos/drivers/filesystems/fastfat_new/close.c
trunk/reactos/drivers/filesystems/fastfat_new/create.c
trunk/reactos/drivers/filesystems/fastfat_new/device.c
trunk/reactos/drivers/filesystems/fastfat_new/dir.c
trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c
trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
trunk/reactos/drivers/filesystems/fastfat_new/finfo.c
trunk/reactos/drivers/filesystems/fastfat_new/flush.c
trunk/reactos/drivers/filesystems/fastfat_new/fsctl.c
trunk/reactos/drivers/filesystems/fastfat_new/lock.c
trunk/reactos/drivers/filesystems/fastfat_new/rw.c
trunk/reactos/drivers/filesystems/fastfat_new/shutdown.c
trunk/reactos/drivers/filesystems/fastfat_new/volume.c
Modified: trunk/reactos/drivers/filesystems/fastfat_new/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/cleanup.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/cleanup.c [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -17,7 +17,7 @@
NTAPI
FatCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
- DPRINT("FatCleanup(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ DPRINT1("FatCleanup(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/close.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/close.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/close.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -17,7 +17,7 @@
NTAPI
FatClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
- DPRINT("FatClose(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ DPRINT1("FatClose(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -17,6 +17,7 @@
NTAPI
FatCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatCreate()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/device.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/device.c [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -17,6 +17,7 @@
NTAPI
FatDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatDeviceControl()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/dir.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/dir.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/dir.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -17,6 +17,7 @@
NTAPI
FatDirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatDirectoryControl()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -114,5 +114,112 @@
return STATUS_SUCCESS;
}
+PFAT_IRP_CONTEXT
+NTAPI
+FatBuildIrpContext(PIRP Irp,
+ BOOLEAN CanWait)
+{
+ PIO_STACK_LOCATION IrpSp;
+ PFAT_IRP_CONTEXT IrpContext;
+ PVOLUME_DEVICE_OBJECT VolumeObject;
+
+ /* Get current IRP stack location */
+ IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+ /* Allocate memory for the Irp context */
+ IrpContext = ExAllocateFromNPagedLookasideList(&FatGlobalData.IrpContextList);
+
+ /* Zero init memory */
+ RtlZeroMemory(IrpContext, sizeof(FAT_IRP_CONTEXT));
+
+ /* Save IRP, MJ and MN */
+ IrpContext->Irp = Irp;
+ IrpContext->MajorFunction = IrpSp->MajorFunction;
+ IrpContext->MinorFunction = IrpSp->MinorFunction;
+
+ /* Set DeviceObject */
+ if (IrpSp->FileObject)
+ {
+ IrpContext->DeviceObject = IrpSp->FileObject->DeviceObject;
+
+ /* Save VCB pointer */
+ VolumeObject = (PVOLUME_DEVICE_OBJECT)IrpSp->DeviceObject;
+ IrpContext->Vcb = &VolumeObject->Vcb;
+
+ /* TODO: Handle write-through */
+ }
+ else if (IrpContext->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL)
+ {
+ /* Handle FSCTRL case */
+ IrpContext->DeviceObject =
IrpSp->Parameters.MountVolume.Vpb->RealDevice;
+ }
+
+ /* Set Wait flag */
+ if (CanWait) IrpContext->Flags |= IRPCONTEXT_CANWAIT;
+
+ /* Return prepared context */
+ return IrpContext;
+}
+
+VOID
+NTAPI
+FatDestroyIrpContext(PFAT_IRP_CONTEXT IrpContext)
+{
+ PAGED_CODE();
+
+ /* Make sure it has no pinned stuff */
+ ASSERT(IrpContext->PinCount == 0);
+
+ /* If there is a FatIo context associated with it - free it */
+ if (IrpContext->FatIoContext)
+ {
+ if (!(IrpContext->Flags & IRPCONTEXT_STACK_IO_CONTEXT))
+ {
+ /* If a zero mdl was allocated - free it */
+ if (IrpContext->FatIoContext->ZeroMdl)
+ IoFreeMdl(IrpContext->FatIoContext->ZeroMdl);
+
+ /* Free memory of FatIo context */
+ ExFreePool(IrpContext->FatIoContext);
+ }
+ }
+
+ /* Free memory */
+ ExFreeToNPagedLookasideList(&FatGlobalData.IrpContextList, IrpContext);
+}
+
+VOID
+NTAPI
+FatCompleteRequest(PFAT_IRP_CONTEXT IrpContext OPTIONAL,
+ PIRP Irp OPTIONAL,
+ NTSTATUS Status)
+{
+ PAGED_CODE();
+
+ if (IrpContext)
+ {
+ /* TODO: Unpin repinned BCBs */
+ //ASSERT(IrpContext->Repinned.Bcb[0] == NULL);
+ //FatUnpinRepinnedBcbs( IrpContext );
+
+ /* Destroy IRP context */
+ FatDestroyIrpContext(IrpContext);
+ }
+
+ /* Complete the IRP */
+ if (Irp)
+ {
+ /* Cleanup IoStatus.Information in case of error input operation */
+ if (NT_ERROR(Status) && (Irp->Flags & IRP_INPUT_OPERATION))
+ {
+ Irp->IoStatus.Information = 0;
+ }
+
+ /* Save status and complete this IRP */
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest( Irp, IO_DISK_INCREMENT );
+ }
+}
+
+
/* EOF */
-
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -3,6 +3,7 @@
#include <reactos/helper.h>
#include <debug.h>
+/* FAT on-disk data structures */
#include <pshpack1.h>
struct _BootSector
{
@@ -164,46 +165,15 @@
#include <poppack.h>
-#define VFAT_CASE_LOWER_BASE 8 // base is lower case
-#define VFAT_CASE_LOWER_EXT 16 // extension is lower case
-
-#define LONGNAME_MAX_LENGTH 256 // max length for a long filename
-
-#define ENTRY_DELETED(DeviceExt, DirEntry) ((DeviceExt)->Flags & VCB_IS_FATX ?
FATX_ENTRY_DELETED(&((DirEntry)->FatX)) :
FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
-#define ENTRY_VOLUME(DeviceExt, DirEntry) ((DeviceExt)->Flags & VCB_IS_FATX ?
FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) :
FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
-#define ENTRY_END(DeviceExt, DirEntry) ((DeviceExt)->Flags & VCB_IS_FATX ?
FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
-
-#define FAT_ENTRY_DELETED(DirEntry) ((DirEntry)->Filename[0] == 0xe5)
-#define FAT_ENTRY_END(DirEntry) ((DirEntry)->Filename[0] == 0)
-#define FAT_ENTRY_LONG(DirEntry) (((DirEntry)->Attrib & 0x3f) == 0x0f)
-#define FAT_ENTRY_VOLUME(DirEntry) (((DirEntry)->Attrib & 0x1f) == 0x08)
-
-#define FATX_ENTRY_DELETED(DirEntry) ((DirEntry)->FilenameLength == 0xe5)
-#define FATX_ENTRY_END(DirEntry) ((DirEntry)->FilenameLength == 0xff)
-#define FATX_ENTRY_LONG(DirEntry) (FALSE)
-#define FATX_ENTRY_VOLUME(DirEntry) (((DirEntry)->Attrib & 0x1f) == 0x08)
-
-#define FAT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FAT_DIR_ENTRY))
-#define FATX_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FATX_DIR_ENTRY))
-
-typedef struct _FATXDirEntry FATX_DIR_ENTRY, *PFATX_DIR_ENTRY;
-
-union _DIR_ENTRY
-{
- FAT_DIR_ENTRY Fat;
- FATX_DIR_ENTRY FatX;
-};
-
-typedef union _DIR_ENTRY DIR_ENTRY, *PDIR_ENTRY;
-
-#define BLOCKSIZE 512
-
+
+/* File system types */
#define FAT16 (1)
#define FAT12 (2)
#define FAT32 (3)
#define FATX16 (4)
#define FATX32 (5)
+/* VCB Flags */
#define VCB_VOLUME_LOCKED 0x0001
#define VCB_DISMOUNT_PENDING 0x0002
#define VCB_IS_FATX 0x0004
@@ -232,23 +202,7 @@
struct _VFATFCB;
struct _VFAT_DIRENTRY_CONTEXT;
-typedef struct _HASHENTRY
-{
- ULONG Hash;
- struct _VFATFCB* self;
- struct _HASHENTRY* next;
-}
-HASHENTRY;
-
-#define FCB_HASH_TABLE_SIZE 65536
-
typedef struct DEVICE_EXTENSION *PDEVICE_EXTENSION;
-
-typedef NTSTATUS (*PGET_NEXT_CLUSTER)(PDEVICE_EXTENSION,ULONG,PULONG);
-typedef NTSTATUS (*PFIND_AND_MARK_AVAILABLE_CLUSTER)(PDEVICE_EXTENSION,PULONG);
-typedef NTSTATUS (*PWRITE_CLUSTER)(PDEVICE_EXTENSION,ULONG,ULONG,PULONG);
-
-typedef NTSTATUS (*PGET_NEXT_DIR_ENTRY)(PVOID*,PVOID*,struct _VFATFCB*,struct
_VFAT_DIRENTRY_CONTEXT*,BOOLEAN);
typedef struct _DEVICE_EXTENSION
{
@@ -269,19 +223,10 @@
ULONG Flags;
struct _VFATFCB * VolumeFcb;
- /* Pointers to functions for manipulating FAT. */
- PGET_NEXT_CLUSTER GetNextCluster;
- PFIND_AND_MARK_AVAILABLE_CLUSTER FindAndMarkAvailableCluster;
- PWRITE_CLUSTER WriteCluster;
- ULONG CleanShutBitMask;
-
- /* Pointers to functions for manipulating directory entries. */
- PGET_NEXT_DIR_ENTRY GetNextDirEntry;
-
ULONG BaseDateYear;
LIST_ENTRY VolumeListEntry;
-} DEVICE_EXTENSION, VCB, *PVCB;
+} DEVICE_EXTENSION;
typedef struct _FAT_GLOBAL_DATA
{
@@ -298,6 +243,7 @@
extern VFAT_GLOBAL_DATA VfatGlobalData;
+/* FCB flags */
#define FCB_CACHE_INITIALIZED 0x0001
#define FCB_DELETE_PENDING 0x0002
#define FCB_IS_FAT 0x0004
@@ -315,9 +261,6 @@
ERESOURCE PagingIoResource;
/* end FCB header required by ROS/NT */
- /* directory entry for this file or directory */
- DIR_ENTRY entry;
-
/* Pointer to attributes in entry */
PUCHAR Attributes;
@@ -365,12 +308,6 @@
/* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
ULONG OpenHandleCount;
-
- /* Entry into the hash table for the path + long name */
- HASHENTRY Hash;
-
- /* Entry into the hash table for the path + short name */
- HASHENTRY ShortHash;
/* List of byte-range locks for this file */
FILE_LOCK FileLock;
@@ -394,6 +331,21 @@
UNICODE_STRING SearchPattern;
} VFATCCB, *PVFATCCB;
+/* Volume Control Block */
+typedef struct _VCB
+{
+ FSRTL_ADVANCED_FCB_HEADER VolumeFileHeader;
+} VCB, *PVCB;
+
+/* Volume Device Object */
+typedef struct _VOLUME_DEVICE_OBJECT
+{
+ DEVICE_OBJECT DeviceObject;
+ FSRTL_COMMON_FCB_HEADER VolumeHeader;
+ VCB Vcb; /* Must be the last entry! */
+} VOLUME_DEVICE_OBJECT, *PVOLUME_DEVICE_OBJECT;
+
+
#ifndef TAG
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#endif
@@ -402,8 +354,6 @@
#define TAG_FCB TAG('V', 'F', 'C', 'B')
#define TAG_IRP TAG('V', 'I', 'R', 'P')
#define TAG_VFAT TAG('V', 'F', 'A', 'T')
-
-#define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))
typedef struct __DOSTIME
{
@@ -421,33 +371,32 @@
}
DOSDATE, *PDOSDATE;
-#define IRPCONTEXT_CANWAIT 0x0001
+#define IRPCONTEXT_CANWAIT 0x0001
#define IRPCONTEXT_PENDINGRETURNED 0x0002
+#define IRPCONTEXT_STACK_IO_CONTEXT 0x0004
typedef struct _FAT_IRP_CONTEXT
{
PIRP Irp;
PDEVICE_OBJECT DeviceObject;
- PDEVICE_EXTENSION DeviceExt;
- ULONG Flags;
- WORK_QUEUE_ITEM WorkQueueItem;
- PIO_STACK_LOCATION Stack;
UCHAR MajorFunction;
UCHAR MinorFunction;
PFILE_OBJECT FileObject;
- ULONG RefCount;
+ ULONG Flags;
+ PVCB Vcb;
+ ULONG PinCount;
+ struct _FAT_IO_CONTEXT *FatIoContext;
+
+ PDEVICE_EXTENSION DeviceExt;
+ WORK_QUEUE_ITEM WorkQueueItem;
+ PIO_STACK_LOCATION Stack;
KEVENT Event;
} FAT_IRP_CONTEXT, *PFAT_IRP_CONTEXT;
-typedef struct _VFAT_DIRENTRY_CONTEXT
-{
- ULONG StartIndex;
- ULONG DirIndex;
- DIR_ENTRY DirEntry;
- UNICODE_STRING LongNameU;
- UNICODE_STRING ShortNameU;
-} VFAT_DIRENTRY_CONTEXT, *PVFAT_DIRENTRY_CONTEXT;
-
+typedef struct _FAT_IO_CONTEXT
+{
+ PMDL ZeroMdl;
+} _FAT_IO_CONTEXT, *PFAT_IO_CONTEXT;
/* ------------------------------------------------------ shutdown.c */
@@ -511,6 +460,20 @@
VOID NTAPI
FatNoopRelease(IN PVOID Context);
+/* --------------------------------------------------------- fastfat.c */
+
+PFAT_IRP_CONTEXT NTAPI
+FatBuildIrpContext(PIRP Irp, BOOLEAN CanWait);
+
+VOID NTAPI
+FatDestroyIrpContext(PFAT_IRP_CONTEXT IrpContext);
+
+VOID NTAPI
+FatCompleteRequest(PFAT_IRP_CONTEXT IrpContext OPTIONAL,
+ PIRP Irp OPTIONAL,
+ NTSTATUS Status);
+
+
/* --------------------------------------------------------- lock.c */
NTSTATUS NTAPI
Modified: trunk/reactos/drivers/filesystems/fastfat_new/finfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -17,6 +17,7 @@
NTAPI
FatQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatQueryInformation()\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -24,6 +25,7 @@
NTAPI
FatSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatSetInformation()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/flush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/flush.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/flush.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -18,6 +18,7 @@
NTAPI
FatFlushBuffers(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatFlushBuffers()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/fsctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/fsctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/fsctl.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -15,9 +15,102 @@
NTSTATUS
NTAPI
+FatUserFsCtrl(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
+{
+ DPRINT1("FatUserFsCtrl()\n");
+ FatCompleteRequest(IrpContext, Irp, STATUS_INVALID_DEVICE_REQUEST);
+ return STATUS_INVALID_DEVICE_REQUEST;
+}
+
+NTSTATUS
+NTAPI
+FatVerifyVolume(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
+{
+ DPRINT1("FatVerifyVolume()\n");
+ FatCompleteRequest(IrpContext, Irp, STATUS_INVALID_DEVICE_REQUEST);
+ return STATUS_INVALID_DEVICE_REQUEST;
+}
+
+NTSTATUS
+NTAPI
+FatMountVolume(PFAT_IRP_CONTEXT IrpContext,
+ PDEVICE_OBJECT TargetDeviceObject,
+ PVPB Vpb,
+ PDEVICE_OBJECT FsDeviceObject)
+{
+ DPRINT1("FatMountVolume()\n");
+
+ FatCompleteRequest(IrpContext, IrpContext->Irp, STATUS_INVALID_DEVICE_REQUEST);
+ return STATUS_INVALID_DEVICE_REQUEST;
+}
+
+
+
+NTSTATUS
+NTAPI
+FatiFileSystemControl(PFAT_IRP_CONTEXT IrpContext, PIRP Irp)
+{
+ PIO_STACK_LOCATION IrpSp;
+ NTSTATUS Status;
+
+ /* Get current IRP stack location */
+ IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+ /* Dispatch depending on the minor function */
+ switch (IrpSp->MinorFunction)
+ {
+ case IRP_MN_USER_FS_REQUEST:
+ Status = FatUserFsCtrl(IrpContext, Irp);
+ break;
+
+ case IRP_MN_MOUNT_VOLUME:
+ Status = FatMountVolume(IrpContext,
+ IrpSp->Parameters.MountVolume.DeviceObject,
+ IrpSp->Parameters.MountVolume.Vpb,
+ IrpSp->DeviceObject);
+ break;
+
+ case IRP_MN_VERIFY_VOLUME:
+ Status = FatVerifyVolume(IrpContext, Irp);
+ break;
+
+ default:
+ DPRINT1("Unhandled FSCTL minor 0x%x\n", IrpSp->MinorFunction);
+ FatCompleteRequest(IrpContext, Irp, STATUS_INVALID_DEVICE_REQUEST);
+ Status = STATUS_INVALID_DEVICE_REQUEST;
+ }
+
+ return Status;
+}
+
+
+NTSTATUS
+NTAPI
FatFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
- DPRINT("VfatFileSystemControl(DeviceObject %p, Irp %p)\n", DeviceObject,
Irp);
+ NTSTATUS Status = STATUS_SUCCESS;
+ PFAT_IRP_CONTEXT IrpContext;
+ BOOLEAN CanWait = TRUE;
- return STATUS_NOT_IMPLEMENTED;
+ DPRINT1("FatFileSystemControl(DeviceObject %p, Irp %p)\n", DeviceObject,
Irp);
+
+ /* Get CanWait flag */
+ if (IoGetCurrentIrpStackLocation(Irp)->FileObject)
+ {
+ CanWait = IoIsOperationSynchronous(Irp);
+ }
+
+ /* Enter FsRtl critical region */
+ FsRtlEnterFileSystem();
+
+ /* Build an irp context */
+ IrpContext = FatBuildIrpContext(Irp, CanWait);
+
+ /* Call internal function */
+ Status = FatiFileSystemControl(IrpContext, Irp);
+
+ /* Leave FsRtl critical region */
+ FsRtlExitFileSystem();
+
+ return Status;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/lock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/lock.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/lock.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -17,6 +17,7 @@
NTAPI
FatLockControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatLockControl()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/rw.c [iso-8859-1] Wed Jan 14 04:42:56
2009
@@ -17,6 +17,7 @@
NTAPI
FatRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatRead()\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -24,6 +25,7 @@
NTAPI
FatWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatWrite()\n");
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/shutdown.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/shutdown.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/shutdown.c [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -17,7 +17,7 @@
NTAPI
FatShutdown(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
- DPRINT("FatShutdown(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+ DPRINT1("FatShutdown(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
return STATUS_NOT_IMPLEMENTED;
}
Modified: trunk/reactos/drivers/filesystems/fastfat_new/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/volume.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/volume.c [iso-8859-1] Wed Jan 14
04:42:56 2009
@@ -17,6 +17,7 @@
NTAPI
FatQueryVolumeInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatQueryVolumeInfo()\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -24,6 +25,7 @@
NTAPI
FatSetVolumeInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
+ DPRINT1("FatSetVolumeInfo()\n");
return STATUS_NOT_IMPLEMENTED;
}