ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

vfat.h
Go to the documentation of this file.
00001 /* $Id: vfat.h 16656 2005-07-20 02:52:52Z ion $ */
00002 
00003 #include <ddk/ntifs.h>
00004 #include <ddk/ntdddisk.h>
00005 #include <ndk/ntndk.h>
00006 #include <limits.h>
00007 #include <debug.h>
00008 
00009 #define USE_ROS_CC_AND_FS
00010 
00011 #include <pshpack1.h>
00012 struct _BootSector
00013 {
00014   unsigned char  magic0, res0, magic1;
00015   unsigned char  OEMName[8];
00016   unsigned short BytesPerSector;
00017   unsigned char  SectorsPerCluster;
00018   unsigned short ReservedSectors;
00019   unsigned char  FATCount;
00020   unsigned short RootEntries, Sectors;
00021   unsigned char  Media;
00022   unsigned short FATSectors, SectorsPerTrack, Heads;
00023   unsigned long  HiddenSectors, SectorsHuge;
00024   unsigned char  Drive, Res1, Sig;
00025   unsigned long  VolumeID;
00026   unsigned char  VolumeLabel[11], SysType[8];
00027   unsigned char  Res2[448];
00028   unsigned short Signatur1;
00029 };
00030 
00031 struct _BootSector32
00032 {
00033   unsigned char  magic0, res0, magic1;          // 0
00034   unsigned char  OEMName[8];                // 3
00035   unsigned short BytesPerSector;            // 11
00036   unsigned char  SectorsPerCluster;         // 13
00037   unsigned short ReservedSectors;           // 14
00038   unsigned char  FATCount;              // 16
00039   unsigned short RootEntries, Sectors;          // 17
00040   unsigned char  Media;                 // 21
00041   unsigned short FATSectors, SectorsPerTrack, Heads;    // 22
00042   unsigned long  HiddenSectors, SectorsHuge;        // 28
00043   unsigned long  FATSectors32;              // 36
00044   unsigned short ExtFlag;               // 40
00045   unsigned short FSVersion;             // 42
00046   unsigned long  RootCluster;               // 44
00047   unsigned short FSInfoSector;              // 48
00048   unsigned short BootBackup;                // 50
00049   unsigned char  Res3[12];              // 52
00050   unsigned char  Drive;                 // 64
00051   unsigned char  Res4;                  // 65
00052   unsigned char  ExtBootSignature;          // 66
00053   unsigned long  VolumeID;              // 67
00054   unsigned char  VolumeLabel[11], SysType[8];       // 71
00055   unsigned char  Res2[420];             // 90
00056   unsigned short Signature1;                // 510
00057 };
00058 
00059 struct _BootSectorFatX
00060 {
00061    unsigned char SysType[4];        // 0
00062    unsigned long VolumeID;          // 4
00063    unsigned long SectorsPerCluster; // 8
00064    unsigned short FATCount;         // 12
00065    unsigned long Unknown;           // 14
00066    unsigned char Unused[4078];      // 18
00067 };
00068 
00069 struct _FsInfoSector
00070 {
00071   unsigned long  ExtBootSignature2;         // 0
00072   unsigned char  Res6[480];             // 4
00073   unsigned long  FSINFOSignature;           // 484
00074   unsigned long  FreeCluster;               // 488
00075   unsigned long  NextCluster;               // 492
00076   unsigned char  Res7[12];              // 496
00077   unsigned long  Signatur2;             // 508
00078 };
00079 
00080 typedef struct _BootSector BootSector;
00081 
00082 struct _FATDirEntry
00083 {
00084   union
00085   {
00086      struct { unsigned char Filename[8], Ext[3]; };
00087      unsigned char ShortName[11];
00088   };
00089   unsigned char  Attrib;
00090   unsigned char  lCase;
00091   unsigned char  CreationTimeMs;
00092   unsigned short CreationTime,CreationDate,AccessDate;
00093   unsigned short FirstClusterHigh;                      // higher
00094   unsigned short UpdateTime;                            //time create/update
00095   unsigned short UpdateDate;                            //date create/update
00096   unsigned short FirstCluster;
00097   unsigned long  FileSize;
00098 };
00099 
00100 typedef struct _FATDirEntry FAT_DIR_ENTRY, *PFAT_DIR_ENTRY;
00101 
00102 struct _FATXDirEntry
00103 {
00104    unsigned char FilenameLength; // 0
00105    unsigned char Attrib;         // 1
00106    unsigned char Filename[42];   // 2
00107    unsigned long FirstCluster;   // 44
00108    unsigned long FileSize;       // 48
00109    unsigned short UpdateTime;    // 52
00110    unsigned short UpdateDate;    // 54
00111    unsigned short CreationTime;  // 56
00112    unsigned short CreationDate;  // 58
00113    unsigned short AccessTime;    // 60
00114    unsigned short AccessDate;    // 62
00115 };
00116 
00117 struct _slot
00118 {
00119   unsigned char id;               // sequence number for slot
00120   WCHAR  name0_4[5];              // first 5 characters in name
00121   unsigned char attr;             // attribute byte
00122   unsigned char reserved;         // always 0
00123   unsigned char alias_checksum;   // checksum for 8.3 alias
00124   WCHAR  name5_10[6];             // 6 more characters in name
00125   unsigned char start[2];         // starting cluster number
00126   WCHAR  name11_12[2];            // last 2 characters in name
00127 };
00128 
00129 typedef struct _slot slot;
00130 
00131 #include <poppack.h>
00132 
00133 #define VFAT_CASE_LOWER_BASE    8       // base is lower case
00134 #define VFAT_CASE_LOWER_EXT     16      // extension is lower case
00135 
00136 #define LONGNAME_MAX_LENGTH     256     // max length for a long filename
00137 
00138 #define ENTRY_DELETED(DeviceExt, DirEntry) ((DeviceExt)->Flags & VCB_IS_FATX ? FATX_ENTRY_DELETED(&((DirEntry)->FatX)) : FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
00139 #define ENTRY_VOLUME(DeviceExt, DirEntry)  ((DeviceExt)->Flags & VCB_IS_FATX ? FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) : FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
00140 #define ENTRY_END(DeviceExt, DirEntry)     ((DeviceExt)->Flags & VCB_IS_FATX ? FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
00141 
00142 #define FAT_ENTRY_DELETED(DirEntry)  ((DirEntry)->Filename[0] == 0xe5)
00143 #define FAT_ENTRY_END(DirEntry)      ((DirEntry)->Filename[0] == 0)
00144 #define FAT_ENTRY_LONG(DirEntry)     (((DirEntry)->Attrib & 0x3f) == 0x0f)
00145 #define FAT_ENTRY_VOLUME(DirEntry)   (((DirEntry)->Attrib & 0x1f) == 0x08)
00146 
00147 #define FATX_ENTRY_DELETED(DirEntry) ((DirEntry)->FilenameLength == 0xe5)
00148 #define FATX_ENTRY_END(DirEntry)     ((DirEntry)->FilenameLength == 0xff)
00149 #define FATX_ENTRY_LONG(DirEntry)    (FALSE)
00150 #define FATX_ENTRY_VOLUME(DirEntry)  (((DirEntry)->Attrib & 0x1f) == 0x08)
00151 
00152 #define FAT_ENTRIES_PER_PAGE   (PAGE_SIZE / sizeof (FAT_DIR_ENTRY))
00153 #define FATX_ENTRIES_PER_PAGE  (PAGE_SIZE / sizeof (FATX_DIR_ENTRY))
00154 
00155 typedef struct _FATXDirEntry FATX_DIR_ENTRY, *PFATX_DIR_ENTRY;
00156 
00157 union _DIR_ENTRY
00158 {
00159    FAT_DIR_ENTRY Fat;
00160    FATX_DIR_ENTRY FatX;
00161 };
00162 
00163 typedef union _DIR_ENTRY DIR_ENTRY, *PDIR_ENTRY;
00164 
00165 #define BLOCKSIZE 512
00166 
00167 #define FAT16  (1)
00168 #define FAT12  (2)
00169 #define FAT32  (3)
00170 #define FATX16 (4)
00171 #define FATX32 (5)
00172 
00173 #define VCB_VOLUME_LOCKED       0x0001
00174 #define VCB_DISMOUNT_PENDING    0x0002
00175 #define VCB_IS_FATX             0x0004
00176 #define VCB_IS_DIRTY            0x4000 /* Volume is dirty */
00177 #define VCB_CLEAR_DIRTY         0x8000 /* Clean dirty flag at shutdown */
00178 
00179 typedef struct
00180 {
00181   ULONG VolumeID;
00182   ULONG FATStart;
00183   ULONG FATCount;
00184   ULONG FATSectors;
00185   ULONG rootDirectorySectors;
00186   ULONG rootStart;
00187   ULONG dataStart;
00188   ULONG RootCluster;
00189   ULONG SectorsPerCluster;
00190   ULONG BytesPerSector;
00191   ULONG BytesPerCluster;
00192   ULONG NumberOfClusters;
00193   ULONG FatType;
00194   ULONG Sectors;
00195   BOOLEAN FixedMedia;
00196 } FATINFO, *PFATINFO;
00197 
00198 struct _VFATFCB;
00199 struct _VFAT_DIRENTRY_CONTEXT;
00200 
00201 typedef struct _HASHENTRY
00202 {
00203   ULONG Hash;
00204   struct _VFATFCB* self;
00205   struct _HASHENTRY* next;
00206 }
00207 HASHENTRY;
00208 
00209 #define FCB_HASH_TABLE_SIZE 65536
00210 
00211 typedef struct DEVICE_EXTENSION *PDEVICE_EXTENSION;
00212 
00213 typedef NTSTATUS (*PGET_NEXT_CLUSTER)(PDEVICE_EXTENSION,ULONG,PULONG);
00214 typedef NTSTATUS (*PFIND_AND_MARK_AVAILABLE_CLUSTER)(PDEVICE_EXTENSION,PULONG);
00215 typedef NTSTATUS (*PWRITE_CLUSTER)(PDEVICE_EXTENSION,ULONG,ULONG,PULONG);
00216 
00217 typedef NTSTATUS (*PGET_NEXT_DIR_ENTRY)(PVOID*,PVOID*,struct _VFATFCB*,struct _VFAT_DIRENTRY_CONTEXT*,BOOLEAN);
00218 
00219 typedef struct DEVICE_EXTENSION
00220 {
00221   ERESOURCE DirResource;
00222   ERESOURCE FatResource;
00223 
00224   KSPIN_LOCK FcbListLock;
00225   LIST_ENTRY FcbListHead;
00226   ULONG HashTableSize;
00227   struct _HASHENTRY** FcbHashTable;
00228 
00229   PDEVICE_OBJECT StorageDevice;
00230   PFILE_OBJECT FATFileObject;
00231   FATINFO FatInfo;
00232   ULONG LastAvailableCluster;
00233   ULONG AvailableClusters;
00234   BOOLEAN AvailableClustersValid;
00235   ULONG Flags;
00236   struct _VFATFCB * VolumeFcb;
00237 
00238   /* Pointers to functions for manipulating FAT. */
00239   PGET_NEXT_CLUSTER GetNextCluster;
00240   PFIND_AND_MARK_AVAILABLE_CLUSTER FindAndMarkAvailableCluster;
00241   PWRITE_CLUSTER WriteCluster;
00242   ULONG CleanShutBitMask;
00243 
00244   /* Pointers to functions for manipulating directory entries. */
00245   PGET_NEXT_DIR_ENTRY GetNextDirEntry;
00246 
00247   ULONG BaseDateYear;
00248 
00249   LIST_ENTRY VolumeListEntry;
00250 } DEVICE_EXTENSION, VCB, *PVCB;
00251 
00252 typedef struct
00253 {
00254   PDRIVER_OBJECT DriverObject;
00255   PDEVICE_OBJECT DeviceObject;
00256   ULONG Flags;
00257   ERESOURCE VolumeListLock;
00258   LIST_ENTRY VolumeListHead;
00259   NPAGED_LOOKASIDE_LIST FcbLookasideList;
00260   NPAGED_LOOKASIDE_LIST CcbLookasideList;
00261   NPAGED_LOOKASIDE_LIST IrpContextLookasideList;
00262   FAST_IO_DISPATCH FastIoDispatch;
00263   CACHE_MANAGER_CALLBACKS CacheMgrCallbacks;
00264 } VFAT_GLOBAL_DATA, *PVFAT_GLOBAL_DATA;
00265 
00266 extern PVFAT_GLOBAL_DATA VfatGlobalData;
00267 
00268 #define FCB_CACHE_INITIALIZED   0x0001
00269 #define FCB_DELETE_PENDING      0x0002
00270 #define FCB_IS_FAT              0x0004
00271 #define FCB_IS_PAGE_FILE        0x0008
00272 #define FCB_IS_VOLUME           0x0010
00273 #define FCB_IS_DIRTY            0x0020
00274 #define FCB_IS_FATX_ENTRY       0x0040
00275 
00276 typedef struct _VFATFCB
00277 {
00278   /* FCB header required by ROS/NT */
00279   FSRTL_COMMON_FCB_HEADER RFCB;
00280   SECTION_OBJECT_POINTERS SectionObjectPointers;
00281   ERESOURCE MainResource;
00282   ERESOURCE PagingIoResource;
00283   /* end FCB header required by ROS/NT */
00284 
00285   /* directory entry for this file or directory */
00286   DIR_ENTRY entry;
00287 
00288   /* Pointer to attributes in entry */
00289   PUCHAR Attributes;
00290 
00291   /* long file name, points into PathNameBuffer */
00292   UNICODE_STRING LongNameU;
00293 
00294   /* short file name */
00295   UNICODE_STRING ShortNameU;
00296 
00297   /* directory name, points into PathNameBuffer */
00298   UNICODE_STRING DirNameU;
00299 
00300   /* path + long file name 260 max*/
00301   UNICODE_STRING PathNameU;
00302 
00303   /* buffer for PathNameU */
00304   PWCHAR PathNameBuffer;
00305 
00306   /* buffer for ShortNameU */
00307   WCHAR ShortNameBuffer[13];
00308 
00309   /* */
00310   LONG RefCount;
00311 
00312   /* List of FCB's for this volume */
00313   LIST_ENTRY FcbListEntry;
00314 
00315   /* pointer to the parent fcb */
00316   struct _VFATFCB* parentFcb;
00317 
00318   /* Flags for the fcb */
00319   ULONG Flags;
00320 
00321   /* pointer to the file object which has initialized the fcb */
00322   PFILE_OBJECT FileObject;
00323 
00324   /* Directory index for the short name entry */
00325   ULONG dirIndex;
00326 
00327   /* Directory index where the long name starts */
00328   ULONG startIndex;
00329 
00330   /* Share access for the file object */
00331   SHARE_ACCESS FCBShareAccess;
00332 
00333   /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
00334   ULONG OpenHandleCount;
00335 
00336   /* Entry into the hash table for the path + long name */
00337   HASHENTRY Hash;
00338 
00339   /* Entry into the hash table for the path + short name */
00340   HASHENTRY ShortHash;
00341 
00342   /* List of byte-range locks for this file */
00343   FILE_LOCK FileLock;
00344 
00345   /*
00346    * Optimalization: caching of last read/write cluster+offset pair. Can't
00347    * be in VFATCCB because it must be reset everytime the allocated clusters
00348    * change.
00349    */
00350   FAST_MUTEX LastMutex;
00351   ULONG LastCluster;
00352   ULONG LastOffset;
00353 } VFATFCB, *PVFATFCB;
00354 
00355 typedef struct _VFATCCB
00356 {
00357   LARGE_INTEGER  CurrentByteOffset;
00358   /* for DirectoryControl */
00359   ULONG Entry;
00360   /* for DirectoryControl */
00361   UNICODE_STRING SearchPattern;
00362 } VFATCCB, *PVFATCCB;
00363 
00364 #define TAG_CCB 'BCCV'
00365 #define TAG_FCB 'BCFV'
00366 #define TAG_IRP 'PRIV'
00367 
00368 #define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))
00369 
00370 typedef struct __DOSTIME
00371 {
00372    USHORT Second:5;
00373    USHORT Minute:6;
00374    USHORT Hour:5;
00375 }
00376 DOSTIME, *PDOSTIME;
00377 
00378 typedef struct __DOSDATE
00379 {
00380    USHORT Day:5;
00381    USHORT Month:4;
00382    USHORT Year:5;
00383 }
00384 DOSDATE, *PDOSDATE;
00385 
00386 #define IRPCONTEXT_CANWAIT      0x0001
00387 #define IRPCONTEXT_PENDINGRETURNED  0x0002
00388 
00389 typedef struct
00390 {
00391    PIRP Irp;
00392    PDEVICE_OBJECT DeviceObject;
00393    PDEVICE_EXTENSION DeviceExt;
00394    ULONG Flags;
00395    WORK_QUEUE_ITEM WorkQueueItem;
00396    PIO_STACK_LOCATION Stack;
00397    UCHAR MajorFunction;
00398    UCHAR MinorFunction;
00399    PFILE_OBJECT FileObject;
00400    ULONG RefCount;
00401    KEVENT Event;
00402 } VFAT_IRP_CONTEXT, *PVFAT_IRP_CONTEXT;
00403 
00404 typedef struct _VFAT_DIRENTRY_CONTEXT
00405 {
00406   ULONG StartIndex;
00407   ULONG DirIndex;
00408   DIR_ENTRY DirEntry;
00409   UNICODE_STRING LongNameU;
00410   UNICODE_STRING ShortNameU;
00411 } VFAT_DIRENTRY_CONTEXT, *PVFAT_DIRENTRY_CONTEXT;
00412 
00413 
00414 /*  ------------------------------------------------------  shutdown.c  */
00415 
00416 NTSTATUS NTAPI VfatShutdown (PDEVICE_OBJECT DeviceObject,
00417                                PIRP Irp);
00418 
00419 /*  --------------------------------------------------------  volume.c  */
00420 
00421 NTSTATUS VfatQueryVolumeInformation (PVFAT_IRP_CONTEXT IrpContext);
00422 
00423 NTSTATUS VfatSetVolumeInformation (PVFAT_IRP_CONTEXT IrpContext);
00424 
00425 /*  ------------------------------------------------------  blockdev.c  */
00426 
00427 NTSTATUS VfatReadDisk(IN PDEVICE_OBJECT pDeviceObject,
00428                       IN PLARGE_INTEGER ReadOffset,
00429                       IN ULONG ReadLength,
00430                       IN PUCHAR Buffer,
00431                       IN BOOLEAN Override);
00432 
00433 NTSTATUS VfatReadDiskPartial (IN PVFAT_IRP_CONTEXT IrpContext,
00434                   IN PLARGE_INTEGER ReadOffset,
00435                   IN ULONG ReadLength,
00436                   IN ULONG BufferOffset,
00437                   IN BOOLEAN Wait);
00438 
00439 NTSTATUS VfatWriteDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext,
00440                   IN PLARGE_INTEGER WriteOffset,
00441                   IN ULONG WriteLength,
00442                   IN ULONG BufferOffset,
00443                   IN BOOLEAN Wait);
00444 
00445 NTSTATUS VfatBlockDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
00446                    IN ULONG CtlCode,
00447                    IN PVOID InputBuffer,
00448                    IN ULONG InputBufferSize,
00449                    IN OUT PVOID OutputBuffer,
00450                    IN OUT PULONG pOutputBufferSize,
00451                    IN BOOLEAN Override);
00452 
00453 /*  -----------------------------------------------------------  dir.c  */
00454 
00455 NTSTATUS VfatDirectoryControl (PVFAT_IRP_CONTEXT);
00456 
00457 BOOLEAN FsdDosDateTimeToSystemTime (PDEVICE_EXTENSION DeviceExt,
00458                                     USHORT DosDate,
00459                                     USHORT DosTime,
00460                                     PLARGE_INTEGER SystemTime);
00461 
00462 BOOLEAN FsdSystemTimeToDosDateTime (PDEVICE_EXTENSION DeviceExt,
00463                                     PLARGE_INTEGER SystemTime,
00464                                     USHORT *pDosDate,
00465                                     USHORT *pDosTime);
00466 
00467 /*  --------------------------------------------------------  create.c  */
00468 
00469 NTSTATUS VfatCreate (PVFAT_IRP_CONTEXT IrpContext);
00470 
00471 NTSTATUS VfatOpenFile (PDEVICE_EXTENSION DeviceExt,
00472                        PFILE_OBJECT FileObject,
00473                PVFATFCB* parentFcb);
00474 
00475 NTSTATUS FindFile (PDEVICE_EXTENSION DeviceExt,
00476                    PVFATFCB Parent,
00477                    PUNICODE_STRING FileToFindU,
00478            PVFAT_DIRENTRY_CONTEXT DirContext,
00479            BOOLEAN First);
00480 
00481 VOID vfat8Dot3ToString (PFAT_DIR_ENTRY pEntry,
00482                         PUNICODE_STRING NameU);
00483 
00484 NTSTATUS ReadVolumeLabel(PDEVICE_EXTENSION DeviceExt,
00485                          PVPB Vpb);
00486 
00487 /*  ---------------------------------------------------------  close.c  */
00488 
00489 NTSTATUS VfatClose (PVFAT_IRP_CONTEXT IrpContext);
00490 
00491 NTSTATUS VfatCloseFile(PDEVICE_EXTENSION DeviceExt,
00492                        PFILE_OBJECT FileObject);
00493 
00494 /*  -------------------------------------------------------  cleanup.c  */
00495 
00496 NTSTATUS VfatCleanup (PVFAT_IRP_CONTEXT IrpContext);
00497 
00498 /*  ---------------------------------------------------------  fastio.c  */
00499 
00500 VOID
00501 VfatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch);
00502 
00503 BOOLEAN NTAPI
00504 VfatAcquireForLazyWrite(IN PVOID Context,
00505                         IN BOOLEAN Wait);
00506 
00507 VOID NTAPI
00508 VfatReleaseFromLazyWrite(IN PVOID Context);
00509 
00510 BOOLEAN NTAPI
00511 VfatAcquireForReadAhead(IN PVOID Context,
00512                         IN BOOLEAN Wait);
00513 
00514 VOID NTAPI
00515 VfatReleaseFromReadAhead(IN PVOID Context);
00516 
00517 /*  ---------------------------------------------------------  fsctl.c  */
00518 
00519 NTSTATUS VfatFileSystemControl (PVFAT_IRP_CONTEXT IrpContext);
00520 
00521 /*  ---------------------------------------------------------  finfo.c  */
00522 
00523 NTSTATUS VfatQueryInformation (PVFAT_IRP_CONTEXT IrpContext);
00524 
00525 NTSTATUS VfatSetInformation (PVFAT_IRP_CONTEXT IrpContext);
00526 
00527 NTSTATUS
00528 VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject,
00529                  PVFATFCB Fcb,
00530                  PDEVICE_EXTENSION DeviceExt,
00531                  PLARGE_INTEGER AllocationSize);
00532 
00533 /*  ---------------------------------------------------------  iface.c  */
00534 
00535 NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject,
00536                               PUNICODE_STRING RegistryPath);
00537 
00538 /*  ---------------------------------------------------------  dirwr.c  */
00539 
00540 NTSTATUS VfatAddEntry (PDEVICE_EXTENSION DeviceExt,
00541                PUNICODE_STRING PathNameU,
00542                PVFATFCB* Fcb,
00543                PVFATFCB ParentFcb,
00544                ULONG RequestedOptions,
00545                UCHAR ReqAttr);
00546 
00547 NTSTATUS VfatUpdateEntry (PVFATFCB pFcb);
00548 
00549 NTSTATUS VfatDelEntry(PDEVICE_EXTENSION, PVFATFCB);
00550 
00551 BOOLEAN
00552 vfatFindDirSpace(PDEVICE_EXTENSION DeviceExt,
00553                  PVFATFCB pDirFcb,
00554                  ULONG nbSlots,
00555                  PULONG start);
00556 
00557 /*  --------------------------------------------------------  string.c  */
00558 
00559 VOID
00560 vfatSplitPathName(PUNICODE_STRING PathNameU,
00561           PUNICODE_STRING DirNameU,
00562           PUNICODE_STRING FileNameU);
00563 
00564 BOOLEAN vfatIsLongIllegal(WCHAR c);
00565 
00566 BOOLEAN wstrcmpjoki (PWSTR s1,
00567                      PWSTR s2);
00568 
00569 /*  -----------------------------------------------------------  fat.c  */
00570 
00571 NTSTATUS FAT12GetNextCluster(PDEVICE_EXTENSION DeviceExt,
00572                              ULONG CurrentCluster,
00573                              PULONG NextCluster);
00574 
00575 NTSTATUS FAT12FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt,
00576                                           PULONG Cluster);
00577 
00578 NTSTATUS FAT12WriteCluster(PDEVICE_EXTENSION DeviceExt,
00579                            ULONG ClusterToWrite,
00580                            ULONG NewValue,
00581                            PULONG OldValue);
00582 
00583 NTSTATUS FAT16GetNextCluster(PDEVICE_EXTENSION DeviceExt,
00584                              ULONG CurrentCluster,
00585                              PULONG NextCluster);
00586 
00587 NTSTATUS FAT16FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt,
00588                                           PULONG Cluster);
00589 
00590 NTSTATUS FAT16WriteCluster(PDEVICE_EXTENSION DeviceExt,
00591                            ULONG ClusterToWrite,
00592                            ULONG NewValue,
00593                            PULONG OldValue);
00594 
00595 NTSTATUS FAT32GetNextCluster(PDEVICE_EXTENSION DeviceExt,
00596                              ULONG CurrentCluster,
00597                              PULONG NextCluster);
00598 
00599 NTSTATUS FAT32FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt,
00600                                           PULONG Cluster);
00601 
00602 NTSTATUS FAT32WriteCluster(PDEVICE_EXTENSION DeviceExt,
00603                            ULONG ClusterToWrite,
00604                            ULONG NewValue,
00605                            PULONG OldValue);
00606 
00607 NTSTATUS OffsetToCluster (PDEVICE_EXTENSION DeviceExt,
00608                           ULONG FirstCluster,
00609                           ULONG FileOffset,
00610                           PULONG Cluster,
00611                           BOOLEAN Extend);
00612 
00613 ULONGLONG ClusterToSector (PDEVICE_EXTENSION DeviceExt,
00614                ULONG Cluster);
00615 
00616 NTSTATUS GetNextCluster (PDEVICE_EXTENSION DeviceExt,
00617                          ULONG CurrentCluster,
00618                          PULONG NextCluster);
00619 
00620 NTSTATUS GetNextClusterExtend (PDEVICE_EXTENSION DeviceExt,
00621                            ULONG CurrentCluster,
00622                            PULONG NextCluster);
00623 
00624 NTSTATUS CountAvailableClusters (PDEVICE_EXTENSION DeviceExt,
00625                                  PLARGE_INTEGER Clusters);
00626 
00627 NTSTATUS
00628 WriteCluster(PDEVICE_EXTENSION DeviceExt,
00629          ULONG ClusterToWrite,
00630          ULONG NewValue);
00631 
00632 /*  ------------------------------------------------------  direntry.c  */
00633 
00634 ULONG  vfatDirEntryGetFirstCluster (PDEVICE_EXTENSION  pDeviceExt,
00635                                     PDIR_ENTRY  pDirEntry);
00636 
00637 BOOLEAN VfatIsDirectoryEmpty(PVFATFCB Fcb);
00638 
00639 NTSTATUS FATGetNextDirEntry(PVOID * pContext,
00640                  PVOID * pPage,
00641                  IN PVFATFCB pDirFcb,
00642                  IN PVFAT_DIRENTRY_CONTEXT DirContext,
00643                  BOOLEAN First);
00644 
00645 NTSTATUS FATXGetNextDirEntry(PVOID * pContext,
00646                  PVOID * pPage,
00647                  IN PVFATFCB pDirFcb,
00648                  IN PVFAT_DIRENTRY_CONTEXT DirContext,
00649                  BOOLEAN First);
00650 
00651 /*  -----------------------------------------------------------  fcb.c  */
00652 
00653 PVFATFCB vfatNewFCB (PDEVICE_EXTENSION  pVCB,
00654                         PUNICODE_STRING pFileNameU);
00655 
00656 VOID vfatDestroyFCB (PVFATFCB  pFCB);
00657 
00658 VOID vfatDestroyCCB(PVFATCCB pCcb);
00659 
00660 VOID vfatGrabFCB (PDEVICE_EXTENSION  pVCB,
00661                   PVFATFCB  pFCB);
00662 
00663 VOID vfatReleaseFCB (PDEVICE_EXTENSION  pVCB,
00664                      PVFATFCB  pFCB);
00665 
00666 VOID vfatAddFCBToTable (PDEVICE_EXTENSION  pVCB,
00667                         PVFATFCB  pFCB);
00668 
00669 PVFATFCB vfatGrabFCBFromTable (PDEVICE_EXTENSION  pDeviceExt,
00670                                PUNICODE_STRING  pFileNameU);
00671 
00672 PVFATFCB vfatMakeRootFCB (PDEVICE_EXTENSION  pVCB);
00673 
00674 PVFATFCB vfatOpenRootFCB (PDEVICE_EXTENSION  pVCB);
00675 
00676 BOOLEAN vfatFCBIsDirectory (PVFATFCB FCB);
00677 
00678 BOOLEAN vfatFCBIsRoot(PVFATFCB FCB);
00679 
00680 NTSTATUS vfatAttachFCBToFileObject (PDEVICE_EXTENSION  vcb,
00681                                     PVFATFCB  fcb,
00682                                     PFILE_OBJECT  fileObject);
00683 
00684 NTSTATUS vfatDirFindFile (PDEVICE_EXTENSION  pVCB,
00685                           PVFATFCB  parentFCB,
00686                           PUNICODE_STRING FileToFindU,
00687                           PVFATFCB * fileFCB);
00688 
00689 NTSTATUS vfatGetFCBForFile (PDEVICE_EXTENSION  pVCB,
00690                             PVFATFCB  *pParentFCB,
00691                             PVFATFCB  *pFCB,
00692                             PUNICODE_STRING pFileNameU);
00693 
00694 NTSTATUS vfatMakeFCBFromDirEntry (PVCB  vcb,
00695                                   PVFATFCB  directoryFCB,
00696                   PVFAT_DIRENTRY_CONTEXT DirContext,
00697                                   PVFATFCB * fileFCB);
00698 
00699 /*  ------------------------------------------------------------  rw.c  */
00700 
00701 NTSTATUS VfatRead (PVFAT_IRP_CONTEXT IrpContext);
00702 
00703 NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext);
00704 
00705 NTSTATUS NextCluster(PDEVICE_EXTENSION DeviceExt,
00706                      ULONG FirstCluster,
00707                      PULONG CurrentCluster,
00708                      BOOLEAN Extend);
00709 
00710 /*  -----------------------------------------------------------  misc.c  */
00711 
00712 NTSTATUS VfatQueueRequest(PVFAT_IRP_CONTEXT IrpContext);
00713 
00714 PVFAT_IRP_CONTEXT VfatAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
00715                                          PIRP Irp);
00716 
00717 VOID VfatFreeIrpContext(PVFAT_IRP_CONTEXT IrpContext);
00718 
00719 NTSTATUS NTAPI VfatBuildRequest (PDEVICE_OBJECT DeviceObject,
00720                                    PIRP Irp);
00721 
00722 PVOID VfatGetUserBuffer(IN PIRP);
00723 
00724 NTSTATUS VfatLockUserBuffer(IN PIRP, IN ULONG,
00725                             IN LOCK_OPERATION);
00726 
00727 NTSTATUS
00728 VfatSetExtendedAttributes(PFILE_OBJECT FileObject,
00729               PVOID Ea,
00730               ULONG EaLength);
00731 /*  ------------------------------------------------------------- flush.c  */
00732 
00733 NTSTATUS VfatFlush(PVFAT_IRP_CONTEXT IrpContext);
00734 
00735 NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb);
00736 
00737 
00738 /* EOF */

Generated on Sat May 26 2012 04:26:21 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.