[FASTFAT]
[reactos.git] / reactos / drivers / filesystems / fastfat / vfat.h
index 3521d31..791daf2 100644 (file)
@@ -1,7 +1,9 @@
+#ifndef _FASTFAT_PCH_
+#define _FASTFAT_PCH_
+
 #include <ntifs.h>
-#include <bugcodes.h>
 #include <ntdddisk.h>
-#include <debug.h>
+#include <dos.h>
 
 #define USE_ROS_CC_AND_FS
 
 #include <pshpack1.h>
 struct _BootSector
 {
-  unsigned char  magic0, res0, magic1;
-  unsigned char  OEMName[8];
-  unsigned short BytesPerSector;
-  unsigned char  SectorsPerCluster;
-  unsigned short ReservedSectors;
-  unsigned char  FATCount;
-  unsigned short RootEntries, Sectors;
-  unsigned char  Media;
-  unsigned short FATSectors, SectorsPerTrack, Heads;
-  unsigned long  HiddenSectors, SectorsHuge;
-  unsigned char  Drive, Res1, Sig;
-  unsigned long  VolumeID;
-  unsigned char  VolumeLabel[11], SysType[8];
-  unsigned char  Res2[448];
-  unsigned short Signatur1;
+    unsigned char  magic0, res0, magic1;
+    unsigned char  OEMName[8];
+    unsigned short BytesPerSector;
+    unsigned char  SectorsPerCluster;
+    unsigned short ReservedSectors;
+    unsigned char  FATCount;
+    unsigned short RootEntries, Sectors;
+    unsigned char  Media;
+    unsigned short FATSectors, SectorsPerTrack, Heads;
+    unsigned long  HiddenSectors, SectorsHuge;
+    unsigned char  Drive, Res1, Sig;
+    unsigned long  VolumeID;
+    unsigned char  VolumeLabel[11], SysType[8];
+    unsigned char  Res2[448];
+    unsigned short Signatur1;
 };
 
 struct _BootSector32
 {
-  unsigned char  magic0, res0, magic1;                 // 0
-  unsigned char  OEMName[8];                           // 3
-  unsigned short BytesPerSector;                       // 11
-  unsigned char  SectorsPerCluster;                    // 13
-  unsigned short ReservedSectors;                      // 14
-  unsigned char  FATCount;                             // 16
-  unsigned short RootEntries, Sectors;                 // 17
-  unsigned char  Media;                                        // 21
-  unsigned short FATSectors, SectorsPerTrack, Heads;   // 22
-  unsigned long  HiddenSectors, SectorsHuge;           // 28
-  unsigned long  FATSectors32;                         // 36
-  unsigned short ExtFlag;                              // 40
-  unsigned short FSVersion;                            // 42
-  unsigned long  RootCluster;                          // 44
-  unsigned short FSInfoSector;                         // 48
-  unsigned short BootBackup;                           // 50
-  unsigned char  Res3[12];                             // 52
-  unsigned char  Drive;                                        // 64
-  unsigned char  Res4;                                 // 65
-  unsigned char  ExtBootSignature;                     // 66
-  unsigned long  VolumeID;                             // 67
-  unsigned char  VolumeLabel[11], SysType[8];          // 71
-  unsigned char  Res2[420];                            // 90
-  unsigned short Signature1;                           // 510
+    unsigned char  magic0, res0, magic1;                       // 0
+    unsigned char  OEMName[8];                         // 3
+    unsigned short BytesPerSector;                     // 11
+    unsigned char  SectorsPerCluster;                  // 13
+    unsigned short ReservedSectors;                    // 14
+    unsigned char  FATCount;                           // 16
+    unsigned short RootEntries, Sectors;                       // 17
+    unsigned char  Media;                                      // 21
+    unsigned short FATSectors, SectorsPerTrack, Heads; // 22
+    unsigned long  HiddenSectors, SectorsHuge;         // 28
+    unsigned long  FATSectors32;                               // 36
+    unsigned short ExtFlag;                            // 40
+    unsigned short FSVersion;                          // 42
+    unsigned long  RootCluster;                                // 44
+    unsigned short FSInfoSector;                               // 48
+    unsigned short BootBackup;                         // 50
+    unsigned char  Res3[12];                           // 52
+    unsigned char  Drive;                                      // 64
+    unsigned char  Res4;                                       // 65
+    unsigned char  ExtBootSignature;                   // 66
+    unsigned long  VolumeID;                           // 67
+    unsigned char  VolumeLabel[11], SysType[8];                // 71
+    unsigned char  Res2[420];                          // 90
+    unsigned short Signature1;                         // 510
 };
 
 struct _BootSectorFatX
 {
-   unsigned char SysType[4];        // 0
-   unsigned long VolumeID;          // 4
-   unsigned long SectorsPerCluster; // 8
-   unsigned short FATCount;         // 12
-   unsigned long Unknown;           // 14
-   unsigned char Unused[4078];      // 18
+    unsigned char SysType[4];        // 0
+    unsigned long VolumeID;          // 4
+    unsigned long SectorsPerCluster; // 8
+    unsigned short FATCount;         // 12
+    unsigned long Unknown;           // 14
+    unsigned char Unused[4078];      // 18
 };
 
 struct _FsInfoSector
 {
-  unsigned long  ExtBootSignature2;                    // 0
-  unsigned char  Res6[480];                            // 4
-  unsigned long  FSINFOSignature;                      // 484
-  unsigned long  FreeCluster;                          // 488
-  unsigned long  NextCluster;                          // 492
-  unsigned char  Res7[12];                             // 496
-  unsigned long  Signatur2;                            // 508
+    unsigned long  ExtBootSignature2;                  // 0
+    unsigned char  Res6[480];                          // 4
+    unsigned long  FSINFOSignature;                    // 484
+    unsigned long  FreeCluster;                                // 488
+    unsigned long  NextCluster;                                // 492
+    unsigned char  Res7[12];                           // 496
+    unsigned long  Signatur2;                          // 508
 };
 
 typedef struct _BootSector BootSector;
 
 struct _FATDirEntry
 {
-  union
-  {
-     struct { unsigned char Filename[8], Ext[3]; };
-     unsigned char ShortName[11];
-  };
-  unsigned char  Attrib;
-  unsigned char  lCase;
-  unsigned char  CreationTimeMs;
-  unsigned short CreationTime,CreationDate,AccessDate;
-  union
-  {
-    unsigned short FirstClusterHigh; // FAT32
-    unsigned short ExtendedAttributes; // FAT12/FAT16
-  };
-  unsigned short UpdateTime;                            //time create/update
-  unsigned short UpdateDate;                            //date create/update
-  unsigned short FirstCluster;
-  unsigned long  FileSize;
+    union
+    {
+        struct { unsigned char Filename[8], Ext[3]; };
+        unsigned char ShortName[11];
+    };
+    unsigned char  Attrib;
+    unsigned char  lCase;
+    unsigned char  CreationTimeMs;
+    unsigned short CreationTime,CreationDate,AccessDate;
+    union
+    {
+        unsigned short FirstClusterHigh; // FAT32
+        unsigned short ExtendedAttributes; // FAT12/FAT16
+    };
+    unsigned short UpdateTime;                            //time create/update
+    unsigned short UpdateDate;                            //date create/update
+    unsigned short FirstCluster;
+    unsigned long  FileSize;
 };
 
 #define FAT_EAFILE  "EA DATA. SF"
@@ -110,62 +112,62 @@ typedef struct _EAFileHeader FAT_EA_FILE_HEADER, *PFAT_EA_FILE_HEADER;
 
 struct _EAFileHeader
 {
-  unsigned short Signature; // ED
-  unsigned short Unknown[15];
-  unsigned short EASetTable[240];
+    unsigned short Signature; // ED
+    unsigned short Unknown[15];
+    unsigned short EASetTable[240];
 };
 
 typedef struct _EASetHeader FAT_EA_SET_HEADER, *PFAT_EA_SET_HEADER;
 
 struct _EASetHeader
 {
-  unsigned short Signature; // EA
-  unsigned short Offset; // relative offset, same value as in the EASetTable
-  unsigned short Unknown1[2];
-  char TargetFileName[12];
-  unsigned short Unknown2[3];
-  unsigned int EALength;
-  // EA Header
+    unsigned short Signature; // EA
+    unsigned short Offset; // relative offset, same value as in the EASetTable
+    unsigned short Unknown1[2];
+    char TargetFileName[12];
+    unsigned short Unknown2[3];
+    unsigned int EALength;
+    // EA Header
 };
 
 typedef struct _EAHeader FAT_EA_HEADER, *PFAT_EA_HEADER;
 
 struct _EAHeader
 {
-  unsigned char Unknown;
-  unsigned char EANameLength;
-  unsigned short EAValueLength;
-  // Name Data
-  // Value Data
+    unsigned char Unknown;
+    unsigned char EANameLength;
+    unsigned short EAValueLength;
+    // Name Data
+    // Value Data
 };
 
 typedef struct _FATDirEntry FAT_DIR_ENTRY, *PFAT_DIR_ENTRY;
 
 struct _FATXDirEntry
 {
-   unsigned char FilenameLength; // 0
-   unsigned char Attrib;         // 1
-   unsigned char Filename[42];   // 2
-   unsigned long FirstCluster;   // 44
-   unsigned long FileSize;       // 48
-   unsigned short UpdateTime;    // 52
-   unsigned short UpdateDate;    // 54
-   unsigned short CreationTime;  // 56
-   unsigned short CreationDate;  // 58
-   unsigned short AccessTime;    // 60
-   unsigned short AccessDate;    // 62
+    unsigned char FilenameLength; // 0
+    unsigned char Attrib;         // 1
+    unsigned char Filename[42];   // 2
+    unsigned long FirstCluster;   // 44
+    unsigned long FileSize;       // 48
+    unsigned short UpdateTime;    // 52
+    unsigned short UpdateDate;    // 54
+    unsigned short CreationTime;  // 56
+    unsigned short CreationDate;  // 58
+    unsigned short AccessTime;    // 60
+    unsigned short AccessDate;    // 62
 };
 
 struct _slot
 {
-  unsigned char id;               // sequence number for slot
-  WCHAR  name0_4[5];              // first 5 characters in name
-  unsigned char attr;             // attribute byte
-  unsigned char reserved;         // always 0
-  unsigned char alias_checksum;   // checksum for 8.3 alias
-  WCHAR  name5_10[6];             // 6 more characters in name
-  unsigned char start[2];         // starting cluster number
-  WCHAR  name11_12[2];            // last 2 characters in name
+    unsigned char id;               // sequence number for slot
+    WCHAR  name0_4[5];              // first 5 characters in name
+    unsigned char attr;             // attribute byte
+    unsigned char reserved;         // always 0
+    unsigned char alias_checksum;   // checksum for 8.3 alias
+    WCHAR  name5_10[6];             // 6 more characters in name
+    unsigned char start[2];         // starting cluster number
+    WCHAR  name11_12[2];            // last 2 characters in name
 };
 
 typedef struct _slot slot;
@@ -198,8 +200,8 @@ typedef struct _FATXDirEntry FATX_DIR_ENTRY, *PFATX_DIR_ENTRY;
 
 union _DIR_ENTRY
 {
-   FAT_DIR_ENTRY Fat;
-   FATX_DIR_ENTRY FatX;
+    FAT_DIR_ENTRY Fat;
+    FATX_DIR_ENTRY FatX;
 };
 
 typedef union _DIR_ENTRY DIR_ENTRY, *PDIR_ENTRY;
@@ -220,21 +222,21 @@ typedef union _DIR_ENTRY DIR_ENTRY, *PDIR_ENTRY;
 
 typedef struct
 {
-  ULONG VolumeID;
-  ULONG FATStart;
-  ULONG FATCount;
-  ULONG FATSectors;
-  ULONG rootDirectorySectors;
-  ULONG rootStart;
-  ULONG dataStart;
-  ULONG RootCluster;
-  ULONG SectorsPerCluster;
-  ULONG BytesPerSector;
-  ULONG BytesPerCluster;
-  ULONG NumberOfClusters;
-  ULONG FatType;
-  ULONG Sectors;
-  BOOLEAN FixedMedia;
+    ULONG VolumeID;
+    ULONG FATStart;
+    ULONG FATCount;
+    ULONG FATSectors;
+    ULONG rootDirectorySectors;
+    ULONG rootStart;
+    ULONG dataStart;
+    ULONG RootCluster;
+    ULONG SectorsPerCluster;
+    ULONG BytesPerSector;
+    ULONG BytesPerCluster;
+    ULONG NumberOfClusters;
+    ULONG FatType;
+    ULONG Sectors;
+    BOOLEAN FixedMedia;
 } FATINFO, *PFATINFO;
 
 struct _VFATFCB;
@@ -242,9 +244,9 @@ struct _VFAT_DIRENTRY_CONTEXT;
 
 typedef struct _HASHENTRY
 {
-  ULONG Hash;
-  struct _VFATFCB* self;
-  struct _HASHENTRY* next;
+    ULONG Hash;
+    struct _VFATFCB* self;
+    struct _HASHENTRY* next;
 }
 HASHENTRY;
 
@@ -260,49 +262,49 @@ typedef NTSTATUS (*PGET_NEXT_DIR_ENTRY)(PVOID*,PVOID*,struct _VFATFCB*,struct _V
 
 typedef struct DEVICE_EXTENSION
 {
-  ERESOURCE DirResource;
-  ERESOURCE FatResource;
-
-  KSPIN_LOCK FcbListLock;
-  LIST_ENTRY FcbListHead;
-  ULONG HashTableSize;
-  struct _HASHENTRY** FcbHashTable;
-
-  PDEVICE_OBJECT StorageDevice;
-  PFILE_OBJECT FATFileObject;
-  FATINFO FatInfo;
-  ULONG LastAvailableCluster;
-  ULONG AvailableClusters;
-  BOOLEAN AvailableClustersValid;
-  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;
+    ERESOURCE DirResource;
+    ERESOURCE FatResource;
+
+    KSPIN_LOCK FcbListLock;
+    LIST_ENTRY FcbListHead;
+    ULONG HashTableSize;
+    struct _HASHENTRY **FcbHashTable;
+
+    PDEVICE_OBJECT StorageDevice;
+    PFILE_OBJECT FATFileObject;
+    FATINFO FatInfo;
+    ULONG LastAvailableCluster;
+    ULONG AvailableClusters;
+    BOOLEAN AvailableClustersValid;
+    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;
 
 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;
+    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;
 
 extern PVFAT_GLOBAL_DATA VfatGlobalData;
@@ -317,90 +319,90 @@ extern PVFAT_GLOBAL_DATA VfatGlobalData;
 
 typedef struct _VFATFCB
 {
-  /* FCB header required by ROS/NT */
-  FSRTL_COMMON_FCB_HEADER RFCB;
-  SECTION_OBJECT_POINTERS SectionObjectPointers;
-  ERESOURCE MainResource;
-  ERESOURCE PagingIoResource;
-  /* end FCB header required by ROS/NT */
+    /* FCB header required by ROS/NT */
+    FSRTL_COMMON_FCB_HEADER RFCB;
+    SECTION_OBJECT_POINTERS SectionObjectPointers;
+    ERESOURCE MainResource;
+    ERESOURCE PagingIoResource;
+    /* end FCB header required by ROS/NT */
 
-  /* directory entry for this file or directory */
-  DIR_ENTRY entry;
+    /* directory entry for this file or directory */
+    DIR_ENTRY entry;
 
-  /* Pointer to attributes in entry */
-  PUCHAR Attributes;
+    /* Pointer to attributes in entry */
+    PUCHAR Attributes;
 
-  /* long file name, points into PathNameBuffer */
-  UNICODE_STRING LongNameU;
+    /* long file name, points into PathNameBuffer */
+    UNICODE_STRING LongNameU;
 
-  /* short file name */
-  UNICODE_STRING ShortNameU;
+    /* short file name */
+    UNICODE_STRING ShortNameU;
 
-  /* directory name, points into PathNameBuffer */
-  UNICODE_STRING DirNameU;
+    /* directory name, points into PathNameBuffer */
+    UNICODE_STRING DirNameU;
 
-  /* path + long file name 260 max*/
-  UNICODE_STRING PathNameU;
+    /* path + long file name 260 max*/
+    UNICODE_STRING PathNameU;
 
-  /* buffer for PathNameU */
-  PWCHAR PathNameBuffer;
+    /* buffer for PathNameU */
+    PWCHAR PathNameBuffer;
 
-  /* buffer for ShortNameU */
-  WCHAR ShortNameBuffer[13];
+    /* buffer for ShortNameU */
+    WCHAR ShortNameBuffer[13];
 
-  /* */
-  LONG RefCount;
+    /* */
+    LONG RefCount;
 
-  /* List of FCB's for this volume */
-  LIST_ENTRY FcbListEntry;
+    /* List of FCB's for this volume */
+    LIST_ENTRY FcbListEntry;
 
-  /* pointer to the parent fcb */
-  struct _VFATFCB* parentFcb;
+    /* pointer to the parent fcb */
+    struct _VFATFCB *parentFcb;
 
-  /* Flags for the fcb */
-  ULONG Flags;
+    /* Flags for the fcb */
+    ULONG Flags;
 
-  /* pointer to the file object which has initialized the fcb */
-  PFILE_OBJECT FileObject;
+    /* pointer to the file object which has initialized the fcb */
+    PFILE_OBJECT FileObject;
 
-  /* Directory index for the short name entry */
-  ULONG dirIndex;
+    /* Directory index for the short name entry */
+    ULONG dirIndex;
 
-  /* Directory index where the long name starts */
-  ULONG startIndex;
+    /* Directory index where the long name starts */
+    ULONG startIndex;
 
-  /* Share access for the file object */
-  SHARE_ACCESS FCBShareAccess;
+    /* Share access for the file object */
+    SHARE_ACCESS FCBShareAccess;
 
-  /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
-  ULONG OpenHandleCount;
+    /* 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 + long name */
+    HASHENTRY Hash;
 
-  /* Entry into the hash table for the path + short name */
-  HASHENTRY ShortHash;
+    /* Entry into the hash table for the path + short name */
+    HASHENTRY ShortHash;
 
-  /* List of byte-range locks for this file */
-  FILE_LOCK FileLock;
+    /* List of byte-range locks for this file */
+    FILE_LOCK FileLock;
 
-  /*
-   * Optimalization: caching of last read/write cluster+offset pair. Can't
-   * be in VFATCCB because it must be reset everytime the allocated clusters
-   * change.
-   */
-  FAST_MUTEX LastMutex;
-  ULONG LastCluster;
-  ULONG LastOffset;
+    /*
+     * Optimalization: caching of last read/write cluster+offset pair. Can't
+     * be in VFATCCB because it must be reset everytime the allocated clusters
+     * change.
+     */
+    FAST_MUTEX LastMutex;
+    ULONG LastCluster;
+    ULONG LastOffset;
 } VFATFCB, *PVFATFCB;
 
 typedef struct _VFATCCB
 {
-  LARGE_INTEGER  CurrentByteOffset;
-  /* for DirectoryControl */
-  ULONG Entry;
-  /* for DirectoryControl */
-  UNICODE_STRING SearchPattern;
+    LARGE_INTEGER  CurrentByteOffset;
+    /* for DirectoryControl */
+    ULONG Entry;
+    /* for DirectoryControl */
+    UNICODE_STRING SearchPattern;
 } VFATCCB, *PVFATCCB;
 
 #define TAG_CCB  'BCCV'
@@ -412,17 +414,17 @@ typedef struct _VFATCCB
 
 typedef struct __DOSTIME
 {
-   USHORT Second:5;
-   USHORT Minute:6;
-   USHORT Hour:5;
+    USHORT Second:5;
+    USHORT Minute:6;
+    USHORT Hour:5;
 }
 DOSTIME, *PDOSTIME;
 
 typedef struct __DOSDATE
 {
-   USHORT Day:5;
-   USHORT Month:4;
-   USHORT Year:5;
+    USHORT Day:5;
+    USHORT Month:4;
+    USHORT Year:7;
 }
 DOSDATE, *PDOSDATE;
 
@@ -431,352 +433,522 @@ DOSDATE, *PDOSDATE;
 
 typedef struct
 {
-   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;
-   KEVENT Event;
+    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;
+    KEVENT Event;
 } VFAT_IRP_CONTEXT, *PVFAT_IRP_CONTEXT;
 
 typedef struct _VFAT_DIRENTRY_CONTEXT
 {
-  ULONG StartIndex;
-  ULONG DirIndex;
-  DIR_ENTRY DirEntry;
-  UNICODE_STRING LongNameU;
-  UNICODE_STRING ShortNameU;
+    ULONG StartIndex;
+    ULONG DirIndex;
+    DIR_ENTRY DirEntry;
+    UNICODE_STRING LongNameU;
+    UNICODE_STRING ShortNameU;
 } VFAT_DIRENTRY_CONTEXT, *PVFAT_DIRENTRY_CONTEXT;
 
 
-/*  ------------------------------------------------------  shutdown.c  */
+/* blockdev.c */
 
-DRIVER_DISPATCH VfatShutdown;
-NTSTATUS NTAPI VfatShutdown (PDEVICE_OBJECT DeviceObject,
-                               PIRP Irp);
+NTSTATUS
+VfatReadDisk(
+    IN PDEVICE_OBJECT pDeviceObject,
+    IN PLARGE_INTEGER ReadOffset,
+    IN ULONG ReadLength,
+    IN PUCHAR Buffer,
+    IN BOOLEAN Override);
 
-/*  --------------------------------------------------------  volume.c  */
+NTSTATUS
+VfatReadDiskPartial(
+    IN PVFAT_IRP_CONTEXT IrpContext,
+    IN PLARGE_INTEGER ReadOffset,
+    IN ULONG ReadLength,
+    IN ULONG BufferOffset,
+    IN BOOLEAN Wait);
 
-NTSTATUS VfatQueryVolumeInformation (PVFAT_IRP_CONTEXT IrpContext);
+NTSTATUS
+VfatWriteDiskPartial(
+    IN PVFAT_IRP_CONTEXT IrpContext,
+    IN PLARGE_INTEGER WriteOffset,
+    IN ULONG WriteLength,
+    IN ULONG BufferOffset,
+    IN BOOLEAN Wait);
 
-NTSTATUS VfatSetVolumeInformation (PVFAT_IRP_CONTEXT IrpContext);
+NTSTATUS
+VfatBlockDeviceIoControl(
+    IN PDEVICE_OBJECT DeviceObject,
+    IN ULONG CtlCode,
+    IN PVOID InputBuffer,
+    IN ULONG InputBufferSize,
+    IN OUT PVOID OutputBuffer,
+    IN OUT PULONG pOutputBufferSize,
+    IN BOOLEAN Override);
 
-/*  ------------------------------------------------------  blockdev.c  */
+/* cleanup.c */
 
-NTSTATUS VfatReadDisk(IN PDEVICE_OBJECT pDeviceObject,
-                      IN PLARGE_INTEGER ReadOffset,
-                      IN ULONG ReadLength,
-                      IN PUCHAR Buffer,
-                      IN BOOLEAN Override);
+NTSTATUS
+VfatCleanup(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS VfatReadDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext,
-                             IN PLARGE_INTEGER ReadOffset,
-                             IN ULONG ReadLength,
-                             IN ULONG BufferOffset,
-                             IN BOOLEAN Wait);
+/* close.c */
 
-NTSTATUS VfatWriteDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext,
-                             IN PLARGE_INTEGER WriteOffset,
-                             IN ULONG WriteLength,
-                             IN ULONG BufferOffset,
-                             IN BOOLEAN Wait);
+NTSTATUS
+VfatClose(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS VfatBlockDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
-                                  IN ULONG CtlCode,
-                                  IN PVOID InputBuffer,
-                                  IN ULONG InputBufferSize,
-                                  IN OUT PVOID OutputBuffer,
-                                  IN OUT PULONG pOutputBufferSize,
-                                  IN BOOLEAN Override);
+NTSTATUS
+VfatCloseFile(
+    PDEVICE_EXTENSION DeviceExt,
+    PFILE_OBJECT FileObject);
 
-/*  -----------------------------------------------------------  dir.c  */
+/* create.c */
 
-NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT);
+NTSTATUS
+VfatCreate(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-BOOLEAN FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt,
-                                    USHORT DosDate,
-                                    USHORT DosTime,
-                                    PLARGE_INTEGER SystemTime);
+NTSTATUS
+FindFile(
+    PDEVICE_EXTENSION DeviceExt,
+    PVFATFCB Parent,
+    PUNICODE_STRING FileToFindU,
+    PVFAT_DIRENTRY_CONTEXT DirContext,
+    BOOLEAN First);
 
-BOOLEAN FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt,
-                                    PLARGE_INTEGER SystemTime,
-                                    USHORT *pDosDate,
-                                    USHORT *pDosTime);
+VOID
+vfat8Dot3ToString(
+    PFAT_DIR_ENTRY pEntry,
+    PUNICODE_STRING NameU);
 
-/*  --------------------------------------------------------  create.c  */
+NTSTATUS
+ReadVolumeLabel(
+    PDEVICE_EXTENSION DeviceExt,
+    PVPB Vpb);
 
-NTSTATUS VfatCreate (PVFAT_IRP_CONTEXT IrpContext);
+/* dir.c */
 
-NTSTATUS FindFile (PDEVICE_EXTENSION DeviceExt,
-                   PVFATFCB Parent,
-                   PUNICODE_STRING FileToFindU,
-                  PVFAT_DIRENTRY_CONTEXT DirContext,
-                  BOOLEAN First);
+NTSTATUS
+VfatDirectoryControl(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-VOID vfat8Dot3ToString (PFAT_DIR_ENTRY pEntry,
-                        PUNICODE_STRING NameU);
+BOOLEAN
+FsdDosDateTimeToSystemTime(
+    PDEVICE_EXTENSION DeviceExt,
+    USHORT DosDate,
+    USHORT DosTime,
+    PLARGE_INTEGER SystemTime);
 
-NTSTATUS ReadVolumeLabel(PDEVICE_EXTENSION DeviceExt,
-                         PVPB Vpb);
+BOOLEAN
+FsdSystemTimeToDosDateTime(
+    PDEVICE_EXTENSION DeviceExt,
+    PLARGE_INTEGER SystemTime,
+    USHORT *pDosDate,
+    USHORT *pDosTime);
 
-/*  ---------------------------------------------------------  close.c  */
+/* direntry.c */
 
-NTSTATUS VfatClose (PVFAT_IRP_CONTEXT IrpContext);
+ULONG
+vfatDirEntryGetFirstCluster(
+    PDEVICE_EXTENSION pDeviceExt,
+    PDIR_ENTRY pDirEntry);
 
-NTSTATUS VfatCloseFile(PDEVICE_EXTENSION DeviceExt,
-                       PFILE_OBJECT FileObject);
+BOOLEAN
+VfatIsDirectoryEmpty(
+    PVFATFCB Fcb);
 
-/*  -------------------------------------------------------  cleanup.c  */
+NTSTATUS
+FATGetNextDirEntry(
+    PVOID *pContext,
+    PVOID *pPage,
+    IN PVFATFCB pDirFcb,
+    IN PVFAT_DIRENTRY_CONTEXT DirContext,
+    BOOLEAN First);
 
-NTSTATUS VfatCleanup (PVFAT_IRP_CONTEXT IrpContext);
+NTSTATUS
+FATXGetNextDirEntry(
+    PVOID *pContext,
+    PVOID *pPage,
+    IN PVFATFCB pDirFcb,
+    IN PVFAT_DIRENTRY_CONTEXT DirContext,
+    BOOLEAN First);
 
-/*  ---------------------------------------------------------  fastio.c  */
+/* dirwr.c */
 
-VOID
-VfatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch);
+NTSTATUS
+VfatAddEntry(
+    PDEVICE_EXTENSION DeviceExt,
+    PUNICODE_STRING PathNameU,
+    PVFATFCB* Fcb,
+    PVFATFCB ParentFcb,
+    ULONG RequestedOptions,
+    UCHAR ReqAttr);
 
-BOOLEAN NTAPI
-VfatAcquireForLazyWrite(IN PVOID Context,
-                        IN BOOLEAN Wait);
+NTSTATUS
+VfatUpdateEntry(
+    PVFATFCB pFcb);
+
+NTSTATUS
+VfatDelEntry(
+    PDEVICE_EXTENSION,
+    PVFATFCB);
+
+BOOLEAN
+vfatFindDirSpace(
+    PDEVICE_EXTENSION DeviceExt,
+    PVFATFCB pDirFcb,
+    ULONG nbSlots,
+    PULONG start);
 
-VOID NTAPI
-VfatReleaseFromLazyWrite(IN PVOID Context);
+/* ea.h */
 
-BOOLEAN NTAPI
-VfatAcquireForReadAhead(IN PVOID Context,
-                        IN BOOLEAN Wait);
+NTSTATUS
+VfatSetExtendedAttributes(
+    PFILE_OBJECT FileObject,
+    PVOID Ea,
+    ULONG EaLength);
 
-VOID NTAPI
-VfatReleaseFromReadAhead(IN PVOID Context);
+/* fastio.c */
 
-/*  ---------------------------------------------------------  fsctl.c  */
+VOID
+VfatInitFastIoRoutines(
+    PFAST_IO_DISPATCH FastIoDispatch);
 
-NTSTATUS VfatFileSystemControl (PVFAT_IRP_CONTEXT IrpContext);
+BOOLEAN
+NTAPI
+VfatAcquireForLazyWrite(
+    IN PVOID Context,
+    IN BOOLEAN Wait);
+
+VOID
+NTAPI
+VfatReleaseFromLazyWrite(
+    IN PVOID Context);
 
-/*  ---------------------------------------------------------  finfo.c  */
+BOOLEAN
+NTAPI
+VfatAcquireForReadAhead(
+    IN PVOID Context,
+    IN BOOLEAN Wait);
 
-NTSTATUS VfatQueryInformation (PVFAT_IRP_CONTEXT IrpContext);
+VOID
+NTAPI
+VfatReleaseFromReadAhead(
+    IN PVOID Context);
 
-NTSTATUS VfatSetInformation (PVFAT_IRP_CONTEXT IrpContext);
+/* fat.c */
 
 NTSTATUS
-VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject,
-                                PVFATFCB Fcb,
-                                PDEVICE_EXTENSION DeviceExt,
-                                PLARGE_INTEGER AllocationSize);
+FAT12GetNextCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG CurrentCluster,
+    PULONG NextCluster);
 
-/*  ---------------------------------------------------------  iface.c  */
+NTSTATUS
+FAT12FindAndMarkAvailableCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    PULONG Cluster);
 
-NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject,
-                              PUNICODE_STRING RegistryPath);
+NTSTATUS
+FAT12WriteCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG ClusterToWrite,
+    ULONG NewValue,
+    PULONG OldValue);
 
-/*  ---------------------------------------------------------  dirwr.c  */
+NTSTATUS
+FAT16GetNextCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG CurrentCluster,
+    PULONG NextCluster);
 
-NTSTATUS VfatAddEntry (PDEVICE_EXTENSION DeviceExt,
-                      PUNICODE_STRING PathNameU,
-                      PVFATFCB* Fcb,
-                      PVFATFCB ParentFcb,
-                      ULONG RequestedOptions,
-                      UCHAR ReqAttr);
+NTSTATUS
+FAT16FindAndMarkAvailableCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    PULONG Cluster);
 
-NTSTATUS VfatUpdateEntry (PVFATFCB pFcb);
+NTSTATUS
+FAT16WriteCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG ClusterToWrite,
+    ULONG NewValue,
+    PULONG OldValue);
 
-NTSTATUS VfatDelEntry(PDEVICE_EXTENSION, PVFATFCB);
+NTSTATUS
+FAT32GetNextCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG CurrentCluster,
+    PULONG NextCluster);
 
-BOOLEAN
-vfatFindDirSpace(PDEVICE_EXTENSION DeviceExt,
-                 PVFATFCB pDirFcb,
-                 ULONG nbSlots,
-                 PULONG start);
+NTSTATUS
+FAT32FindAndMarkAvailableCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    PULONG Cluster);
 
-/*  --------------------------------------------------------  string.c  */
+NTSTATUS
+FAT32WriteCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG ClusterToWrite,
+    ULONG NewValue,
+    PULONG OldValue);
 
-VOID
-vfatSplitPathName(PUNICODE_STRING PathNameU,
-                 PUNICODE_STRING DirNameU,
-                 PUNICODE_STRING FileNameU);
+NTSTATUS
+OffsetToCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG FirstCluster,
+    ULONG FileOffset,
+    PULONG Cluster,
+    BOOLEAN Extend);
+
+ULONGLONG
+ClusterToSector(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG Cluster);
+
+NTSTATUS
+GetNextCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG CurrentCluster,
+    PULONG NextCluster);
 
-BOOLEAN vfatIsLongIllegal(WCHAR c);
+NTSTATUS
+GetNextClusterExtend(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG CurrentCluster,
+    PULONG NextCluster);
 
-BOOLEAN wstrcmpjoki (PWSTR s1,
-                     PWSTR s2);
+NTSTATUS
+CountAvailableClusters(
+    PDEVICE_EXTENSION DeviceExt,
+    PLARGE_INTEGER Clusters);
 
-/*  -----------------------------------------------------------  fat.c  */
+NTSTATUS
+WriteCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG ClusterToWrite,
+    ULONG NewValue);
 
-NTSTATUS FAT12GetNextCluster(PDEVICE_EXTENSION DeviceExt,
-                             ULONG CurrentCluster,
-                             PULONG NextCluster);
+/* fcb.c */
 
-NTSTATUS FAT12FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt,
-                                          PULONG Cluster);
+PVFATFCB
+vfatNewFCB(
+    PDEVICE_EXTENSION pVCB,
+    PUNICODE_STRING pFileNameU);
 
-NTSTATUS FAT12WriteCluster(PDEVICE_EXTENSION DeviceExt,
-                           ULONG ClusterToWrite,
-                           ULONG NewValue,
-                           PULONG OldValue);
+VOID
+vfatDestroyFCB(
+    PVFATFCB pFCB);
 
-NTSTATUS FAT16GetNextCluster(PDEVICE_EXTENSION DeviceExt,
-                             ULONG CurrentCluster,
-                             PULONG NextCluster);
+VOID
+vfatDestroyCCB(
+    PVFATCCB pCcb);
 
-NTSTATUS FAT16FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt,
-                                          PULONG Cluster);
+VOID
+vfatGrabFCB(
+    PDEVICE_EXTENSION pVCB,
+    PVFATFCB pFCB);
 
-NTSTATUS FAT16WriteCluster(PDEVICE_EXTENSION DeviceExt,
-                           ULONG ClusterToWrite,
-                           ULONG NewValue,
-                           PULONG OldValue);
+VOID
+vfatReleaseFCB(
+    PDEVICE_EXTENSION pVCB,
+    PVFATFCB pFCB);
 
-NTSTATUS FAT32GetNextCluster(PDEVICE_EXTENSION DeviceExt,
-                             ULONG CurrentCluster,
-                             PULONG NextCluster);
+VOID
+vfatAddFCBToTable(
+    PDEVICE_EXTENSION pVCB,
+    PVFATFCB pFCB);
 
-NTSTATUS FAT32FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt,
-                                          PULONG Cluster);
+PVFATFCB
+vfatGrabFCBFromTable(
+    PDEVICE_EXTENSION pDeviceExt,
+    PUNICODE_STRING pFileNameU);
 
-NTSTATUS FAT32WriteCluster(PDEVICE_EXTENSION DeviceExt,
-                           ULONG ClusterToWrite,
-                           ULONG NewValue,
-                           PULONG OldValue);
+PVFATFCB
+vfatMakeRootFCB(
+    PDEVICE_EXTENSION pVCB);
 
-NTSTATUS OffsetToCluster (PDEVICE_EXTENSION DeviceExt,
-                          ULONG FirstCluster,
-                          ULONG FileOffset,
-                          PULONG Cluster,
-                          BOOLEAN Extend);
+PVFATFCB
+vfatOpenRootFCB(
+    PDEVICE_EXTENSION pVCB);
 
-ULONGLONG ClusterToSector (PDEVICE_EXTENSION DeviceExt,
-                          ULONG Cluster);
+BOOLEAN
+vfatFCBIsDirectory(
+    PVFATFCB FCB);
 
-NTSTATUS GetNextCluster (PDEVICE_EXTENSION DeviceExt,
-                         ULONG CurrentCluster,
-                         PULONG NextCluster);
+BOOLEAN
+vfatFCBIsRoot(
+    PVFATFCB FCB);
 
-NTSTATUS GetNextClusterExtend (PDEVICE_EXTENSION DeviceExt,
-                              ULONG CurrentCluster,
-                              PULONG NextCluster);
+NTSTATUS
+vfatAttachFCBToFileObject(
+    PDEVICE_EXTENSION vcb,
+    PVFATFCB fcb,
+    PFILE_OBJECT fileObject);
 
-NTSTATUS CountAvailableClusters (PDEVICE_EXTENSION DeviceExt,
-                                 PLARGE_INTEGER Clusters);
+NTSTATUS
+vfatDirFindFile(
+    PDEVICE_EXTENSION pVCB,
+    PVFATFCB parentFCB,
+    PUNICODE_STRING FileToFindU,
+    PVFATFCB *fileFCB);
 
 NTSTATUS
-WriteCluster(PDEVICE_EXTENSION DeviceExt,
-            ULONG ClusterToWrite,
-            ULONG NewValue);
+vfatGetFCBForFile(
+    PDEVICE_EXTENSION pVCB,
+    PVFATFCB *pParentFCB,
+    PVFATFCB *pFCB,
+    PUNICODE_STRING pFileNameU);
 
-/*  ------------------------------------------------------  direntry.c  */
+NTSTATUS
+vfatMakeFCBFromDirEntry(
+    PVCB vcb,
+    PVFATFCB directoryFCB,
+    PVFAT_DIRENTRY_CONTEXT DirContext,
+    PVFATFCB *fileFCB);
 
-ULONG  vfatDirEntryGetFirstCluster (PDEVICE_EXTENSION  pDeviceExt,
-                                    PDIR_ENTRY  pDirEntry);
+/* finfo.c */
 
-BOOLEAN VfatIsDirectoryEmpty(PVFATFCB Fcb);
+NTSTATUS
+VfatQueryInformation(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS FATGetNextDirEntry(PVOID * pContext,
-                            PVOID * pPage,
-                            IN PVFATFCB pDirFcb,
-                            IN PVFAT_DIRENTRY_CONTEXT DirContext,
-                            BOOLEAN First);
+NTSTATUS
+VfatSetInformation(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS FATXGetNextDirEntry(PVOID * pContext,
-                            PVOID * pPage,
-                            IN PVFATFCB pDirFcb,
-                            IN PVFAT_DIRENTRY_CONTEXT DirContext,
-                            BOOLEAN First);
+NTSTATUS
+VfatSetAllocationSizeInformation(
+    PFILE_OBJECT FileObject,
+    PVFATFCB Fcb,
+    PDEVICE_EXTENSION DeviceExt,
+    PLARGE_INTEGER AllocationSize);
 
-/*  -----------------------------------------------------------  fcb.c  */
+/* flush.c */
 
-PVFATFCB vfatNewFCB (PDEVICE_EXTENSION  pVCB,
-                        PUNICODE_STRING pFileNameU);
+NTSTATUS
+VfatFlush(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-VOID vfatDestroyFCB (PVFATFCB  pFCB);
+NTSTATUS
+VfatFlushVolume(
+    PDEVICE_EXTENSION DeviceExt,
+    PVFATFCB VolumeFcb);
 
-VOID vfatDestroyCCB(PVFATCCB pCcb);
+/* fsctl.c */
 
-VOID vfatGrabFCB (PDEVICE_EXTENSION  pVCB,
-                  PVFATFCB  pFCB);
+NTSTATUS
+VfatFileSystemControl(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-VOID vfatReleaseFCB (PDEVICE_EXTENSION  pVCB,
-                     PVFATFCB  pFCB);
+/* iface.c */
 
-VOID vfatAddFCBToTable (PDEVICE_EXTENSION  pVCB,
-                        PVFATFCB  pFCB);
+NTSTATUS
+NTAPI
+DriverEntry(
+    PDRIVER_OBJECT DriverObject,
+    PUNICODE_STRING RegistryPath);
 
-PVFATFCB vfatGrabFCBFromTable (PDEVICE_EXTENSION  pDeviceExt,
-                               PUNICODE_STRING  pFileNameU);
 
-PVFATFCB vfatMakeRootFCB (PDEVICE_EXTENSION  pVCB);
+/* misc.c */
 
-PVFATFCB vfatOpenRootFCB (PDEVICE_EXTENSION  pVCB);
+NTSTATUS
+VfatQueueRequest(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-BOOLEAN vfatFCBIsDirectory (PVFATFCB FCB);
+PVFAT_IRP_CONTEXT
+VfatAllocateIrpContext(
+    PDEVICE_OBJECT DeviceObject,
+    PIRP Irp);
 
-BOOLEAN vfatFCBIsRoot(PVFATFCB FCB);
+VOID
+VfatFreeIrpContext(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS vfatAttachFCBToFileObject (PDEVICE_EXTENSION  vcb,
-                                    PVFATFCB  fcb,
-                                    PFILE_OBJECT  fileObject);
+DRIVER_DISPATCH
+VfatBuildRequest;
 
-NTSTATUS vfatDirFindFile (PDEVICE_EXTENSION  pVCB,
-                          PVFATFCB  parentFCB,
-                          PUNICODE_STRING FileToFindU,
-                          PVFATFCB * fileFCB);
+NTSTATUS
+NTAPI
+VfatBuildRequest(
+    PDEVICE_OBJECT DeviceObject,
+    PIRP Irp);
 
-NTSTATUS vfatGetFCBForFile (PDEVICE_EXTENSION  pVCB,
-                            PVFATFCB  *pParentFCB,
-                            PVFATFCB  *pFCB,
-                            PUNICODE_STRING pFileNameU);
+PVOID
+VfatGetUserBuffer(
+    IN PIRP);
 
-NTSTATUS vfatMakeFCBFromDirEntry (PVCB  vcb,
-                                  PVFATFCB  directoryFCB,
-                                 PVFAT_DIRENTRY_CONTEXT DirContext,
-                                  PVFATFCB * fileFCB);
+NTSTATUS
+VfatLockUserBuffer(
+    IN PIRP,
+    IN ULONG,
+    IN LOCK_OPERATION);
 
-/*  ------------------------------------------------------------  rw.c  */
+/* pnp.c */
 
-NTSTATUS VfatRead (PVFAT_IRP_CONTEXT IrpContext);
+NTSTATUS
+VfatPnp(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext);
+/* rw.c */
 
-NTSTATUS NextCluster(PDEVICE_EXTENSION DeviceExt,
-                     ULONG FirstCluster,
-                     PULONG CurrentCluster,
-                     BOOLEAN Extend);
+NTSTATUS
+VfatRead(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-/*  -----------------------------------------------------------  misc.c  */
+NTSTATUS
+VfatWrite(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS VfatQueueRequest(PVFAT_IRP_CONTEXT IrpContext);
+NTSTATUS
+NextCluster(
+    PDEVICE_EXTENSION DeviceExt,
+    ULONG FirstCluster,
+    PULONG CurrentCluster,
+    BOOLEAN Extend);
 
-PVFAT_IRP_CONTEXT VfatAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
-                                         PIRP Irp);
+/* shutdown.c */
 
-VOID VfatFreeIrpContext(PVFAT_IRP_CONTEXT IrpContext);
+DRIVER_DISPATCH
+VfatShutdown;
 
-DRIVER_DISPATCH VfatBuildRequest;
-NTSTATUS NTAPI VfatBuildRequest (PDEVICE_OBJECT DeviceObject,
-                                   PIRP Irp);
+NTSTATUS
+NTAPI
+VfatShutdown(
+    PDEVICE_OBJECT DeviceObject,
+    PIRP Irp);
 
-PVOID VfatGetUserBuffer(IN PIRP);
+/* string.c */
 
-NTSTATUS VfatLockUserBuffer(IN PIRP, IN ULONG,
-                            IN LOCK_OPERATION);
+VOID
+vfatSplitPathName(
+    PUNICODE_STRING PathNameU,
+    PUNICODE_STRING DirNameU,
+    PUNICODE_STRING FileNameU);
 
-NTSTATUS
-VfatSetExtendedAttributes(PFILE_OBJECT FileObject,
-                         PVOID Ea,
-                         ULONG EaLength);
-/*  ------------------------------------------------------------- flush.c  */
+BOOLEAN
+vfatIsLongIllegal(
+    WCHAR c);
 
-NTSTATUS VfatFlush(PVFAT_IRP_CONTEXT IrpContext);
+BOOLEAN
+wstrcmpjoki(
+    PWSTR s1,
+    PWSTR s2);
 
-NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb);
+/* volume.c */
 
-/*  --------------------------------------------------------------- pnp.c  */
+NTSTATUS
+VfatQueryVolumeInformation(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-NTSTATUS VfatPnp(PVFAT_IRP_CONTEXT IrpContext);
+NTSTATUS
+VfatSetVolumeInformation(
+    PVFAT_IRP_CONTEXT IrpContext);
 
-/* EOF */
+#endif /* _FASTFAT_PCH_ */