ReactOS  0.4.14-dev-608-gd495a4f
vfat.h
Go to the documentation of this file.
1 #ifndef _FASTFAT_PCH_
2 #define _FASTFAT_PCH_
3 
4 #include <ntifs.h>
5 #include <ntdddisk.h>
6 #include <dos.h>
7 #include <pseh/pseh2.h>
8 #include <section_attribs.h>
9 #ifdef KDBG
10 #include <ndk/kdfuncs.h>
11 #include <reactos/kdros.h>
12 #endif
13 
14 
15 #define USE_ROS_CC_AND_FS
16 #define ENABLE_SWAPOUT
17 
18 /* FIXME: because volume is not cached, we have to perform direct IOs
19  * The day this is fixed, just comment out that line, and check
20  * it still works (and delete old code ;-))
21  */
22 #define VOLUME_IS_NOT_CACHED_WORK_AROUND_IT
23 
24 
25 #define ROUND_DOWN(n, align) \
26  (((ULONG)n) & ~((align) - 1l))
27 
28 #define ROUND_UP(n, align) \
29  ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
30 
31 #define ROUND_DOWN_64(n, align) \
32  (((ULONGLONG)n) & ~((align) - 1LL))
33 
34 #define ROUND_UP_64(n, align) \
35  ROUND_DOWN_64(((ULONGLONG)n) + (align) - 1LL, (align))
36 
37 #include <pshpack1.h>
39 {
40  unsigned char magic0, res0, magic1;
41  unsigned char OEMName[8];
42  unsigned short BytesPerSector;
43  unsigned char SectorsPerCluster;
44  unsigned short ReservedSectors;
45  unsigned char FATCount;
46  unsigned short RootEntries, Sectors;
47  unsigned char Media;
48  unsigned short FATSectors, SectorsPerTrack, Heads;
49  unsigned long HiddenSectors, SectorsHuge;
50  unsigned char Drive, Res1, Sig;
51  unsigned long VolumeID;
52  unsigned char VolumeLabel[11], SysType[8];
53  unsigned char Res2[448];
54  unsigned short Signatur1;
55 };
56 
58 {
59  unsigned char magic0, res0, magic1; // 0
60  unsigned char OEMName[8]; // 3
61  unsigned short BytesPerSector; // 11
62  unsigned char SectorsPerCluster; // 13
63  unsigned short ReservedSectors; // 14
64  unsigned char FATCount; // 16
65  unsigned short RootEntries, Sectors; // 17
66  unsigned char Media; // 21
67  unsigned short FATSectors, SectorsPerTrack, Heads; // 22
68  unsigned long HiddenSectors, SectorsHuge; // 28
69  unsigned long FATSectors32; // 36
70  unsigned short ExtFlag; // 40
71  unsigned short FSVersion; // 42
72  unsigned long RootCluster; // 44
73  unsigned short FSInfoSector; // 48
74  unsigned short BootBackup; // 50
75  unsigned char Res3[12]; // 52
76  unsigned char Drive; // 64
77  unsigned char Res4; // 65
78  unsigned char ExtBootSignature; // 66
79  unsigned long VolumeID; // 67
80  unsigned char VolumeLabel[11], SysType[8]; // 71
81  unsigned char Res2[420]; // 90
82  unsigned short Signature1; // 510
83 };
84 
85 #define FAT_DIRTY_BIT 0x01
86 
88 {
89  unsigned char SysType[4]; // 0
90  unsigned long VolumeID; // 4
91  unsigned long SectorsPerCluster; // 8
92  unsigned short FATCount; // 12
93  unsigned long Unknown; // 14
94  unsigned char Unused[4078]; // 18
95 };
96 
98 {
99  unsigned long ExtBootSignature2; // 0
100  unsigned char Res6[480]; // 4
101  unsigned long FSINFOSignature; // 484
102  unsigned long FreeCluster; // 488
103  unsigned long NextCluster; // 492
104  unsigned char Res7[12]; // 496
105  unsigned long Signatur2; // 508
106 };
107 
108 typedef struct _BootSector BootSector;
109 
111 {
112  union
113  {
114  struct { unsigned char Filename[8], Ext[3]; };
115  unsigned char ShortName[11];
116  };
117  unsigned char Attrib;
118  unsigned char lCase;
119  unsigned char CreationTimeMs;
121  union
122  {
123  unsigned short FirstClusterHigh; // FAT32
124  unsigned short ExtendedAttributes; // FAT12/FAT16
125  };
126  unsigned short UpdateTime; //time create/update
127  unsigned short UpdateDate; //date create/update
128  unsigned short FirstCluster;
129  unsigned long FileSize;
130 };
131 
132 #define FAT_EAFILE "EA DATA. SF"
133 
135 
137 {
138  unsigned short Signature; // ED
139  unsigned short Unknown[15];
140  unsigned short EASetTable[240];
141 };
142 
144 
146 {
147  unsigned short Signature; // EA
148  unsigned short Offset; // relative offset, same value as in the EASetTable
149  unsigned short Unknown1[2];
150  char TargetFileName[12];
151  unsigned short Unknown2[3];
152  unsigned int EALength;
153  // EA Header
154 };
155 
157 
158 struct _EAHeader
159 {
160  unsigned char Unknown;
161  unsigned char EANameLength;
162  unsigned short EAValueLength;
163  // Name Data
164  // Value Data
165 };
166 
168 
170 {
171  unsigned char FilenameLength; // 0
172  unsigned char Attrib; // 1
173  unsigned char Filename[42]; // 2
174  unsigned long FirstCluster; // 44
175  unsigned long FileSize; // 48
176  unsigned short UpdateTime; // 52
177  unsigned short UpdateDate; // 54
178  unsigned short CreationTime; // 56
179  unsigned short CreationDate; // 58
180  unsigned short AccessTime; // 60
181  unsigned short AccessDate; // 62
182 };
183 
184 struct _slot
185 {
186  unsigned char id; // sequence number for slot
187  WCHAR name0_4[5]; // first 5 characters in name
188  unsigned char attr; // attribute byte
189  unsigned char reserved; // always 0
190  unsigned char alias_checksum; // checksum for 8.3 alias
191  WCHAR name5_10[6]; // 6 more characters in name
192  unsigned char start[2]; // starting cluster number
193  WCHAR name11_12[2]; // last 2 characters in name
194 };
195 
196 typedef struct _slot slot;
197 
198 #include <poppack.h>
199 
200 #define VFAT_CASE_LOWER_BASE 8 // base is lower case
201 #define VFAT_CASE_LOWER_EXT 16 // extension is lower case
202 
203 #define LONGNAME_MAX_LENGTH 256 // max length for a long filename
204 
205 #define ENTRY_DELETED(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_DELETED(&((DirEntry)->FatX)) : FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
206 #define ENTRY_VOLUME(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) : FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
207 #define ENTRY_END(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
208 
209 #define FAT_ENTRY_DELETED(DirEntry) ((DirEntry)->Filename[0] == 0xe5)
210 #define FAT_ENTRY_END(DirEntry) ((DirEntry)->Filename[0] == 0)
211 #define FAT_ENTRY_LONG(DirEntry) (((DirEntry)->Attrib & 0x3f) == 0x0f)
212 #define FAT_ENTRY_VOLUME(DirEntry) (((DirEntry)->Attrib & 0x1f) == 0x08)
213 
214 #define FATX_ENTRY_DELETED(DirEntry) ((DirEntry)->FilenameLength == 0xe5)
215 #define FATX_ENTRY_END(DirEntry) ((DirEntry)->FilenameLength == 0xff)
216 #define FATX_ENTRY_LONG(DirEntry) (FALSE)
217 #define FATX_ENTRY_VOLUME(DirEntry) (((DirEntry)->Attrib & 0x1f) == 0x08)
218 
219 #define FAT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FAT_DIR_ENTRY))
220 #define FATX_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FATX_DIR_ENTRY))
221 
223 
225 {
228 };
229 
231 
232 #define BLOCKSIZE 512
233 
234 #define FAT16 (1)
235 #define FAT12 (2)
236 #define FAT32 (3)
237 #define FATX16 (4)
238 #define FATX32 (5)
239 
240 #define VCB_VOLUME_LOCKED 0x0001
241 #define VCB_DISMOUNT_PENDING 0x0002
242 #define VCB_IS_FATX 0x0004
243 #define VCB_IS_SYS_OR_HAS_PAGE 0x0008
244 #define VCB_IS_DIRTY 0x4000 /* Volume is dirty */
245 #define VCB_CLEAR_DIRTY 0x8000 /* Clean dirty flag at shutdown */
246 /* VCB condition state */
247 #define VCB_GOOD 0x0010 /* If not set, the VCB is improper for usage */
248 
249 typedef struct
250 {
252  CHAR VolumeLabel[11];
268 } FATINFO, *PFATINFO;
269 
270 struct _VFATFCB;
272 struct _VFAT_MOVE_CONTEXT;
273 struct _VFAT_CLOSE_CONTEXT;
274 
275 typedef struct _HASHENTRY
276 {
278  struct _VFATFCB* self;
279  struct _HASHENTRY* next;
280 }
281 HASHENTRY;
282 
284 
288 
295 
296 typedef struct _VFAT_DISPATCH
297 {
303 
304 #define STATISTICS_SIZE_NO_PAD (sizeof(FILESYSTEM_STATISTICS) + sizeof(FAT_STATISTICS))
305 typedef struct _STATISTICS {
310 
311 typedef struct DEVICE_EXTENSION
312 {
315 
320 
330  struct _VFATFCB *RootFcb;
332 
333  /* Pointers to functions for manipulating FAT. */
339 
341 
343 
344  /* Notifications */
347 
348  /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLOSE */
350 
351  /* VPBs for dismount */
354 
355  /* Pointers to functions for manipulating directory entries. */
358 
360 BOOLEAN
362  struct _VFATFCB* Fcb)
363 {
364  return DeviceExt->Dispatch.IsDirectoryEmpty(DeviceExt, Fcb);
365 }
366 
368 NTSTATUS
370  PUNICODE_STRING NameU,
371  struct _VFATFCB** Fcb,
372  struct _VFATFCB* ParentFcb,
373  ULONG RequestedOptions,
374  UCHAR ReqAttr,
375  struct _VFAT_MOVE_CONTEXT* MoveContext)
376 {
377  return DeviceExt->Dispatch.AddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr, MoveContext);
378 }
379 
381 NTSTATUS
383  struct _VFATFCB* Fcb,
384  struct _VFAT_MOVE_CONTEXT* MoveContext)
385 {
386  return DeviceExt->Dispatch.DelEntry(DeviceExt, Fcb, MoveContext);
387 }
388 
390 NTSTATUS
392  PVOID *pContext,
393  PVOID *pPage,
394  struct _VFATFCB* pDirFcb,
396  BOOLEAN First)
397 {
398  return DeviceExt->Dispatch.GetNextDirEntry(pContext, pPage, pDirFcb, DirContext, First);
399 }
400 
401 #define VFAT_BREAK_ON_CORRUPTION 1
402 
403 typedef struct
404 {
424 
426 
427 #define FCB_CACHE_INITIALIZED 0x0001
428 #define FCB_DELETE_PENDING 0x0002
429 #define FCB_IS_FAT 0x0004
430 #define FCB_IS_PAGE_FILE 0x0008
431 #define FCB_IS_VOLUME 0x0010
432 #define FCB_IS_DIRTY 0x0020
433 #define FCB_DELAYED_CLOSE 0x0040
434 #ifdef KDBG
435 #define FCB_CLEANED_UP 0x0080
436 #define FCB_CLOSED 0x0100
437 #endif
438 
439 #define NODE_TYPE_FCB ((CSHORT)0x0502)
440 
441 typedef struct _VFATFCB
442 {
443  /* FCB header required by ROS/NT */
448  /* end FCB header required by ROS/NT */
449 
450  /* directory entry for this file or directory */
452 
453  /* Pointer to attributes in entry */
455 
456  /* long file name, points into PathNameBuffer */
458 
459  /* short file name */
461 
462  /* directory name, points into PathNameBuffer */
464 
465  /* path + long file name 260 max*/
467 
468  /* buffer for PathNameU */
470 
471  /* buffer for ShortNameU */
473 
474  /* */
476 
477  /* List of FCB's for this volume */
479 
480  /* List of FCB's for the parent */
482 
483  /* pointer to the parent fcb */
485 
486  /* List for the children */
488 
489  /* Flags for the fcb */
491 
492  /* pointer to the file object which has initialized the fcb */
494 
495  /* Directory index for the short name entry */
497 
498  /* Directory index where the long name starts */
500 
501  /* Share access for the file object */
503 
504  /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
506 
507  /* Entry into the hash table for the path + long name */
509 
510  /* Entry into the hash table for the path + short name */
512 
513  /* List of byte-range locks for this file */
515 
516  /*
517  * Optimization: caching of last read/write cluster+offset pair. Can't
518  * be in VFATCCB because it must be reset everytime the allocated clusters
519  * change.
520  */
524 
526 } VFATFCB, *PVFATFCB;
527 
528 #define CCB_DELETE_ON_CLOSE 0x0001
529 
530 typedef struct _VFATCCB
531 {
534  /* for DirectoryControl */
536  /* for DirectoryControl */
538 } VFATCCB, *PVFATCCB;
539 
540 #define TAG_CCB 'CtaF'
541 #define TAG_FCB 'FtaF'
542 #define TAG_IRP 'ItaF'
543 #define TAG_CLOSE 'xtaF'
544 #define TAG_STATS 'VtaF'
545 #define TAG_BUFFER 'OtaF'
546 #define TAG_VPB 'vtaF'
547 #define TAG_NAME 'ntaF'
548 #define TAG_SEARCH 'LtaF'
549 #define TAG_DIRENT 'DtaF'
550 
551 #define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))
552 
553 typedef struct __DOSTIME
554 {
558 }
559 DOSTIME, *PDOSTIME;
560 
561 typedef struct __DOSDATE
562 {
566 }
567 DOSDATE, *PDOSDATE;
568 
569 #define IRPCONTEXT_CANWAIT 0x0001
570 #define IRPCONTEXT_COMPLETE 0x0002
571 #define IRPCONTEXT_QUEUE 0x0004
572 #define IRPCONTEXT_PENDINGRETURNED 0x0008
573 #define IRPCONTEXT_DEFERRED_WRITE 0x0010
574 
575 typedef struct
576 {
590 
592 {
600 
601 typedef struct _VFAT_MOVE_CONTEXT
602 {
609 
610 typedef struct _VFAT_CLOSE_CONTEXT
611 {
616 
618 NTSTATUS
620 {
621  PULONG Flags = &IrpContext->Flags;
622 
625 
626  return STATUS_PENDING;
627 }
628 
630 BOOLEAN
632 {
633  return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_DIRECTORY);
634 }
635 
637 BOOLEAN
639 {
640  return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_READONLY);
641 }
642 
644 BOOLEAN
646 {
647  return BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX);
648 }
649 
651 VOID
653  IN PDEVICE_EXTENSION DeviceExt,
654  IN PVFATFCB Fcb,
656  IN ULONG Action)
657 {
658  FsRtlNotifyFullReportChange(DeviceExt->NotifySync,
659  &(DeviceExt->NotifyList),
660  (PSTRING)&Fcb->PathNameU,
661  Fcb->PathNameU.Length - Fcb->LongNameU.Length,
663 }
664 
665 #define vfatAddToStat(Vcb, Stat, Inc) \
666 { \
667  PSTATISTICS Stats = &(Vcb)->Statistics[KeGetCurrentProcessorNumber() % VfatGlobalData->NumberProcessors]; \
668  Stats->Stat += Inc; \
669 }
670 
671 /* blockdev.c */
672 
673 NTSTATUS
676  IN PLARGE_INTEGER ReadOffset,
677  IN ULONG ReadLength,
678  IN PUCHAR Buffer,
679  IN BOOLEAN Override);
680 
681 NTSTATUS
683  IN PVFAT_IRP_CONTEXT IrpContext,
684  IN PLARGE_INTEGER ReadOffset,
685  IN ULONG ReadLength,
686  IN ULONG BufferOffset,
687  IN BOOLEAN Wait);
688 
689 NTSTATUS
692  IN PLARGE_INTEGER WriteOffset,
693  IN ULONG WriteLength,
695  IN BOOLEAN Override);
696 
697 NTSTATUS
699  IN PVFAT_IRP_CONTEXT IrpContext,
700  IN PLARGE_INTEGER WriteOffset,
701  IN ULONG WriteLength,
702  IN ULONG BufferOffset,
703  IN BOOLEAN Wait);
704 
705 NTSTATUS
708  IN ULONG CtlCode,
710  IN ULONG InputBufferSize,
712  IN OUT PULONG pOutputBufferSize,
713  IN BOOLEAN Override);
714 
715 /* cleanup.c */
716 
717 NTSTATUS
719  PVFAT_IRP_CONTEXT IrpContext);
720 
721 /* close.c */
722 
723 NTSTATUS
724 VfatClose(
725  PVFAT_IRP_CONTEXT IrpContext);
726 
727 NTSTATUS
729  PDEVICE_EXTENSION DeviceExt,
731 
732 /* create.c */
733 
734 NTSTATUS
735 VfatCreate(
736  PVFAT_IRP_CONTEXT IrpContext);
737 
738 NTSTATUS
739 FindFile(
740  PDEVICE_EXTENSION DeviceExt,
742  PUNICODE_STRING FileToFindU,
744  BOOLEAN First);
745 
746 VOID
748  PFAT_DIR_ENTRY pEntry,
749  PUNICODE_STRING NameU);
750 
751 /* dir.c */
752 
753 NTSTATUS
755  PVFAT_IRP_CONTEXT IrpContext);
756 
757 BOOLEAN
759  PDEVICE_EXTENSION DeviceExt,
760  USHORT DosDate,
761  USHORT DosTime,
762  PLARGE_INTEGER SystemTime);
763 
764 BOOLEAN
766  PDEVICE_EXTENSION DeviceExt,
767  PLARGE_INTEGER SystemTime,
768  USHORT *pDosDate,
769  USHORT *pDosTime);
770 
771 /* direntry.c */
772 
773 ULONG
775  PDEVICE_EXTENSION pDeviceExt,
776  PDIR_ENTRY pDirEntry);
777 
778 /* dirwr.c */
779 
780 NTSTATUS
782  PVCB vcb,
783  PVFATFCB fcb);
784 
785 NTSTATUS
787  IN PDEVICE_EXTENSION DeviceExt,
788  PVFATFCB pFcb);
789 
790 BOOLEAN
792  PDEVICE_EXTENSION DeviceExt,
793  PVFATFCB pDirFcb,
794  ULONG nbSlots,
795  PULONG start);
796 
797 NTSTATUS
799  IN PDEVICE_EXTENSION DeviceExt,
800  IN PVFATFCB pFcb,
802  IN BOOLEAN CaseChangeOnly);
803 
804 NTSTATUS
806  IN PDEVICE_EXTENSION DeviceExt,
807  IN PVFATFCB pFcb,
810 
811 /* ea.h */
812 
813 NTSTATUS
816  PVOID Ea,
817  ULONG EaLength);
818 
819 /* fastio.c */
820 
821 INIT_FUNCTION
822 VOID
825 
826 BOOLEAN
827 NTAPI
829  IN PVOID Context,
830  IN BOOLEAN Wait);
831 
832 VOID
833 NTAPI
835  IN PVOID Context);
836 
837 /* fat.c */
838 
839 NTSTATUS
841  PDEVICE_EXTENSION DeviceExt,
842  ULONG CurrentCluster,
844 
845 NTSTATUS
847  PDEVICE_EXTENSION DeviceExt,
848  PULONG Cluster);
849 
850 NTSTATUS
852  PDEVICE_EXTENSION DeviceExt,
853  ULONG ClusterToWrite,
854  ULONG NewValue,
855  PULONG OldValue);
856 
857 NTSTATUS
859  PDEVICE_EXTENSION DeviceExt,
860  ULONG CurrentCluster,
862 
863 NTSTATUS
865  PDEVICE_EXTENSION DeviceExt,
866  PULONG Cluster);
867 
868 NTSTATUS
870  PDEVICE_EXTENSION DeviceExt,
871  ULONG ClusterToWrite,
872  ULONG NewValue,
873  PULONG OldValue);
874 
875 NTSTATUS
877  PDEVICE_EXTENSION DeviceExt,
878  ULONG CurrentCluster,
880 
881 NTSTATUS
883  PDEVICE_EXTENSION DeviceExt,
884  PULONG Cluster);
885 
886 NTSTATUS
888  PDEVICE_EXTENSION DeviceExt,
889  ULONG ClusterToWrite,
890  ULONG NewValue,
891  PULONG OldValue);
892 
893 NTSTATUS
895  PDEVICE_EXTENSION DeviceExt,
896  ULONG FirstCluster,
898  PULONG Cluster,
899  BOOLEAN Extend);
900 
901 ULONGLONG
903  PDEVICE_EXTENSION DeviceExt,
904  ULONG Cluster);
905 
906 NTSTATUS
908  PDEVICE_EXTENSION DeviceExt,
909  ULONG CurrentCluster,
911 
912 NTSTATUS
914  PDEVICE_EXTENSION DeviceExt,
915  ULONG CurrentCluster,
917 
918 NTSTATUS
920  PDEVICE_EXTENSION DeviceExt,
921  PLARGE_INTEGER Clusters);
922 
923 NTSTATUS
925  PDEVICE_EXTENSION DeviceExt,
926  ULONG ClusterToWrite,
927  ULONG NewValue);
928 
929 NTSTATUS
931  PDEVICE_EXTENSION DeviceExt,
932  PBOOLEAN DirtyStatus);
933 
934 NTSTATUS
936  PDEVICE_EXTENSION DeviceExt,
937  PBOOLEAN DirtyStatus);
938 
939 NTSTATUS
941  PDEVICE_EXTENSION DeviceExt,
942  PBOOLEAN DirtyStatus);
943 
944 NTSTATUS
946  PDEVICE_EXTENSION DeviceExt,
947  BOOLEAN DirtyStatus);
948 
949 NTSTATUS
951  PDEVICE_EXTENSION DeviceExt,
952  BOOLEAN DirtyStatus);
953 
954 NTSTATUS
956  PDEVICE_EXTENSION DeviceExt,
957  BOOLEAN DirtyStatus);
958 
959 NTSTATUS
961  PDEVICE_EXTENSION DeviceExt);
962 
963 /* fcb.c */
964 
965 PVFATFCB
966 vfatNewFCB(
967  PDEVICE_EXTENSION pVCB,
968  PUNICODE_STRING pFileNameU);
969 
970 NTSTATUS
972  PDEVICE_EXTENSION pVCB,
973  PVFATFCB Fcb,
975 
976 NTSTATUS
978  PDEVICE_EXTENSION pVCB,
979  PVFATFCB Fcb,
982 
983 VOID
985  PVFATFCB pFCB);
986 
987 VOID
989  PVFATCCB pCcb);
990 
991 VOID
992 #ifndef KDBG
994 #else
995 _vfatGrabFCB(
996 #endif
997  PDEVICE_EXTENSION pVCB,
998  PVFATFCB pFCB
999 #ifdef KDBG
1000  ,
1001  PCSTR File,
1002  ULONG Line,
1003  PCSTR Func
1004 #endif
1005  );
1006 
1007 VOID
1008 #ifndef KDBG
1010 #else
1011 _vfatReleaseFCB(
1012 #endif
1013  PDEVICE_EXTENSION pVCB,
1014  PVFATFCB pFCB
1015 #ifdef KDBG
1016  ,
1017  PCSTR File,
1018  ULONG Line,
1019  PCSTR Func
1020 #endif
1021  );
1022 
1023 #ifdef KDBG
1024 #define vfatGrabFCB(v, f) _vfatGrabFCB(v, f, __FILE__, __LINE__, __FUNCTION__)
1025 #define vfatReleaseFCB(v, f) _vfatReleaseFCB(v, f, __FILE__, __LINE__, __FUNCTION__)
1026 #endif
1027 
1028 PVFATFCB
1030  PDEVICE_EXTENSION pDeviceExt,
1031  PUNICODE_STRING pFileNameU);
1032 
1033 PVFATFCB
1035  PDEVICE_EXTENSION pVCB);
1036 
1037 PVFATFCB
1039  PDEVICE_EXTENSION pVCB);
1040 
1041 BOOLEAN
1043  PVFATFCB FCB);
1044 
1045 BOOLEAN
1047  PVFATFCB FCB);
1048 
1049 NTSTATUS
1051  PDEVICE_EXTENSION vcb,
1052  PVFATFCB fcb,
1053  PFILE_OBJECT fileObject);
1054 
1055 NTSTATUS
1057  PDEVICE_EXTENSION pVCB,
1058  PVFATFCB parentFCB,
1059  PUNICODE_STRING FileToFindU,
1060  PVFATFCB *fileFCB);
1061 
1062 NTSTATUS
1064  PDEVICE_EXTENSION pVCB,
1065  PVFATFCB *pParentFCB,
1066  PVFATFCB *pFCB,
1067  PUNICODE_STRING pFileNameU);
1068 
1069 NTSTATUS
1071  PVCB vcb,
1072  PVFATFCB directoryFCB,
1074  PVFATFCB *fileFCB);
1075 
1076 /* finfo.c */
1077 
1078 NTSTATUS
1080  PVFATFCB FCB,
1081  PFILE_STANDARD_INFORMATION StandardInfo,
1083 
1084 NTSTATUS
1087  PVFATFCB FCB,
1088  PDEVICE_EXTENSION DeviceExt,
1089  PFILE_BASIC_INFORMATION BasicInfo,
1091 
1092 NTSTATUS
1094  PVFAT_IRP_CONTEXT IrpContext);
1095 
1096 NTSTATUS
1098  PVFAT_IRP_CONTEXT IrpContext);
1099 
1100 NTSTATUS
1103  PVFATFCB Fcb,
1104  PDEVICE_EXTENSION DeviceExt,
1106 
1107 /* flush.c */
1108 
1109 NTSTATUS
1110 VfatFlush(
1111  PVFAT_IRP_CONTEXT IrpContext);
1112 
1113 NTSTATUS
1115  PDEVICE_EXTENSION DeviceExt,
1116  PVFATFCB VolumeFcb);
1117 
1118 /* fsctl.c */
1119 
1120 NTSTATUS
1122  PVFAT_IRP_CONTEXT IrpContext);
1123 
1124 /* iface.c */
1125 
1126 INIT_FUNCTION
1127 NTSTATUS
1128 NTAPI
1129 DriverEntry(
1132 
1133 #ifdef KDBG
1134 /* kdbg.c */
1135 KDBG_CLI_ROUTINE vfatKdbgHandler;
1136 #endif
1137 
1138 /* misc.c */
1139 
1142 
1143 NTSTATUS
1144 NTAPI
1147  PIRP Irp);
1148 
1149 PVOID
1151  IN PIRP Irp,
1152  IN BOOLEAN Paging);
1153 
1154 NTSTATUS
1156  IN PIRP Irp,
1157  IN ULONG Length,
1159 
1160 BOOLEAN
1162  IN PDEVICE_EXTENSION DeviceExt,
1163  IN BOOLEAN Create);
1164 
1165 VOID
1167  IN PDEVICE_EXTENSION DeviceExt,
1168  IN PVFATFCB Fcb,
1170  IN ULONG Action);
1171 
1172 VOID
1173 NTAPI
1175  IN PVOID IrpContext,
1176  IN PVOID Unused);
1177 
1178 /* pnp.c */
1179 
1180 NTSTATUS
1181 VfatPnp(
1182  PVFAT_IRP_CONTEXT IrpContext);
1183 
1184 /* rw.c */
1185 
1186 NTSTATUS
1187 VfatRead(
1188  PVFAT_IRP_CONTEXT IrpContext);
1189 
1190 NTSTATUS
1191 VfatWrite(
1192  PVFAT_IRP_CONTEXT IrpContext);
1193 
1194 NTSTATUS
1195 NextCluster(
1196  PDEVICE_EXTENSION DeviceExt,
1197  ULONG FirstCluster,
1198  PULONG CurrentCluster,
1199  BOOLEAN Extend);
1200 
1201 /* shutdown.c */
1202 
1205 
1206 NTSTATUS
1207 NTAPI
1208 VfatShutdown(
1210  PIRP Irp);
1211 
1212 /* string.c */
1213 
1214 VOID
1216  PUNICODE_STRING PathNameU,
1217  PUNICODE_STRING DirNameU,
1218  PUNICODE_STRING FileNameU);
1219 
1220 BOOLEAN
1222  WCHAR c);
1223 
1224 /* volume.c */
1225 
1226 NTSTATUS
1228  PVFAT_IRP_CONTEXT IrpContext);
1229 
1230 NTSTATUS
1232  PVFAT_IRP_CONTEXT IrpContext);
1233 
1234 #endif /* _FASTFAT_PCH_ */
unsigned long FirstCluster
Definition: vfat.h:174
unsigned short UpdateTime
Definition: vfat.h:126
struct _EASetHeader * PFAT_EA_SET_HEADER
Definition: vfat.h:143
LIST_ENTRY CloseListEntry
Definition: vfat.h:614
unsigned short EAValueLength
Definition: vfat.h:162
PIS_DIRECTORY_EMPTY IsDirectoryEmpty
Definition: vfat.h:298
NTSTATUS(* PFIND_AND_MARK_AVAILABLE_CLUSTER)(PDEVICE_EXTENSION, PULONG)
Definition: vfat.h:286
struct FATINFO * PFATINFO
BOOLEAN AvailableClustersValid
Definition: vfat.h:327
unsigned long HiddenSectors
Definition: vfat.h:68
unsigned char Sig
Definition: vfat.h:50
unsigned short ExtendedAttributes
Definition: vfat.h:124
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1129
unsigned char Unused[4078]
Definition: vfat.h:94
#define IN
Definition: typedefs.h:38
_In_ PNDIS_STRING _In_ PNDIS_STRING _Out_ PDEVICE_OBJECT * pDeviceObject
Definition: ndis.h:4679
struct VFAT_IRP_CONTEXT * PVFAT_IRP_CONTEXT
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: vfat.h:445
NTSTATUS OffsetToCluster(PDEVICE_EXTENSION DeviceExt, ULONG FirstCluster, ULONG FileOffset, PULONG Cluster, BOOLEAN Extend)
Definition: rw.c:61
unsigned short CreationTime
Definition: vfat.h:120
LIST_ENTRY FcbListEntry
Definition: vfat.h:478
NTSTATUS FAT16GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:75
unsigned short Sectors
Definition: vfat.h:46
LIST_ENTRY VolumeListHead
Definition: vfat.h:410
unsigned char FilenameLength
Definition: vfat.h:171
unsigned long SectorsPerCluster
Definition: vfat.h:91
struct DEVICE_EXTENSION * PDEVICE_EXTENSION
Definition: vfat.h:283
VOID NTAPI Extend(VOID)
Definition: extend.c:14
PVOID VfatGetUserBuffer(IN PIRP Irp, IN BOOLEAN Paging)
Definition: misc.c:365
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
unsigned char magic1
Definition: vfat.h:40
unsigned char EANameLength
Definition: vfat.h:161
unsigned long SectorsHuge
Definition: vfat.h:49
unsigned char attr
Definition: vfat.h:188
ULONGLONG ClusterToSector(PDEVICE_EXTENSION DeviceExt, ULONG Cluster)
Definition: fat.c:729
FAST_MUTEX CloseMutex
Definition: vfat.h:417
unsigned short UpdateDate
Definition: vfat.h:177
unsigned char Res4
Definition: vfat.h:77
unsigned char alias_checksum
Definition: vfat.h:190
UNICODE_STRING ShortNameU
Definition: vfat.h:460
NTSTATUS VfatRead(PVFAT_IRP_CONTEXT IrpContext)
Definition: rw.c:710
Definition: vfat.h:441
BOOLEAN vfatIsLongIllegal(WCHAR c)
Definition: string.c:22
BOOLEAN FixedMedia
Definition: vfat.h:266
#define IRPCONTEXT_COMPLETE
Definition: vfat.h:570
NTSTATUS(* PDEL_ENTRY)(PDEVICE_EXTENSION, struct _VFATFCB *, struct _VFAT_MOVE_CONTEXT *)
Definition: vfat.h:291
ULONG dirIndex
Definition: vfat.h:496
unsigned short Unknown1[2]
Definition: vfat.h:149
Definition: vfat.h:530
PDEVICE_EXTENSION DeviceExt
Definition: vfat.h:579
VOID NTAPI VfatReleaseFromLazyWrite(IN PVOID Context)
Definition: fastio.c:746
PDEVICE_OBJECT StorageDevice
Definition: vfat.h:322
NPAGED_LOOKASIDE_LIST FcbLookasideList
Definition: vfat.h:411
unsigned long FileSize
Definition: vfat.h:129
struct _VFATCCB * PVFATCCB
_In_ PIRP Irp
Definition: csq.h:116
unsigned short FSInfoSector
Definition: vfat.h:73
Definition: cdstruc.h:908
NTSTATUS VfatCleanup(PVFAT_IRP_CONTEXT IrpContext)
Definition: cleanup.c:177
PFILE_OBJECT FATFileObject
Definition: vfat.h:323
VOID vfatSplitPathName(PUNICODE_STRING PathNameU, PUNICODE_STRING DirNameU, PUNICODE_STRING FileNameU)
Definition: fcb.c:55
unsigned long VolumeID
Definition: vfat.h:90
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
ULONG LastCluster
Definition: vfat.h:522
unsigned short FATSectors
Definition: vfat.h:67
PDRIVER_OBJECT DriverObject
Definition: vfat.h:405
_In_ BOOLEAN Create
Definition: pstypes.h:511
NTSTATUS FAT12FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:242
NTSTATUS FAT12GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:121
ULONG rootStart
Definition: vfat.h:257
unsigned char SectorsPerCluster
Definition: vfat.h:62
unsigned char * PUCHAR
Definition: retypes.h:3
PIO_WORKITEM CloseWorkItem
Definition: vfat.h:421
char CHAR
Definition: xmlstorage.h:175
PSET_DIRTY_STATUS SetDirtyStatus
Definition: vfat.h:338
unsigned char SysType[8]
Definition: vfat.h:52
unsigned short BytesPerSector
Definition: vfat.h:42
UNICODE_STRING LongNameU
Definition: vfat.h:596
LONG NTSTATUS
Definition: precomp.h:26
unsigned char Unknown
Definition: vfat.h:160
NTSTATUS CountAvailableClusters(PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER Clusters)
Definition: fat.c:539
unsigned long HiddenSectors
Definition: vfat.h:49
BOOLEAN vfatFCBIsRoot(PVFATFCB FCB)
Definition: fcb.c:294
unsigned char Filename[8]
Definition: vfat.h:114
unsigned char Drive
Definition: vfat.h:50
FILESYSTEM_STATISTICS Base
Definition: vfat.h:306
unsigned char CreationTimeMs
Definition: vfat.h:119
NTSTATUS vfatSetFCBNewDirName(PDEVICE_EXTENSION pVCB, PVFATFCB Fcb, PVFATFCB ParentFcb)
Definition: fcb.c:491
NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: volume.c:432
FAST_IO_DISPATCH FastIoDispatch
Definition: vfat.h:415
FORCEINLINE BOOLEAN vfatFCBIsDirectory(PVFATFCB FCB)
Definition: vfat.h:631
PVFAT_GLOBAL_DATA VfatGlobalData
Definition: iface.c:40
ULONG FATStart
Definition: vfat.h:253
unsigned short ExtFlag
Definition: vfat.h:70
UNICODE_STRING LongNameU
Definition: vfat.h:457
Definition: cdstruc.h:504
NTSTATUS vfatAttachFCBToFileObject(PDEVICE_EXTENSION vcb, PVFATFCB fcb, PFILE_OBJECT fileObject)
Definition: fcb.c:755
UCHAR Pad[((STATISTICS_SIZE_NO_PAD+0x3f) &~0x3f) - STATISTICS_SIZE_NO_PAD]
Definition: vfat.h:308
unsigned char VolumeLabel[11]
Definition: vfat.h:80
NTSTATUS VfatUpdateEntry(IN PDEVICE_EXTENSION DeviceExt, PVFATFCB pFcb)
unsigned long Signatur2
Definition: vfat.h:105
struct __DOSTIME * PDOSTIME
NTSTATUS FAT12WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue, PULONG OldValue)
Definition: fat.c:568
ULONG Entry
Definition: vfat.h:535
struct _FATXDirEntry * PFATX_DIR_ENTRY
Definition: vfat.h:222
ULONG SectorsPerCluster
Definition: vfat.h:260
VOID vfatDestroyFCB(PVFATFCB pFCB)
Definition: fcb.c:269
unsigned char magic0
Definition: vfat.h:59
UNICODE_STRING SearchPattern
Definition: vfat.h:537
struct _VFATFCB VFATFCB
unsigned short AccessTime
Definition: vfat.h:180
VOID NTAPI FsRtlNotifyFullReportChange(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PSTRING FullTargetName, IN USHORT TargetNameOffset, IN PSTRING StreamName OPTIONAL, IN PSTRING NormalizedParentName OPTIONAL, IN ULONG FilterMatch, IN ULONG Action, IN PVOID TargetContext)
Definition: notify.c:1523
NTSTATUS FindFile(PDEVICE_EXTENSION DeviceExt, PVFATFCB Parent, PUNICODE_STRING FileToFindU, PVFAT_DIRENTRY_CONTEXT DirContext, BOOLEAN First)
Definition: create.c:101
BOOLEAN FsdDosDateTimeToSystemTime(PDEVICE_EXTENSION DeviceExt, USHORT DosDate, USHORT DosTime, PLARGE_INTEGER SystemTime)
Definition: dir.c:22
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:728
uint16_t * PWCHAR
Definition: typedefs.h:54
unsigned long VolumeID
Definition: vfat.h:51
USHORT Hour
Definition: vfat.h:557
NPAGED_LOOKASIDE_LIST IrpContextLookasideList
Definition: vfat.h:413
PVFATFCB vfatMakeRootFCB(PDEVICE_EXTENSION pVCB)
Definition: fcb.c:648
NTSTATUS VfatWriteDisk(IN PDEVICE_OBJECT pDeviceObject, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN OUT PUCHAR Buffer, IN BOOLEAN Override)
Definition: blockdev.c:255
unsigned char magic0
Definition: vfat.h:40
FAT_DIR_ENTRY Fat
Definition: vfat.h:226
PFILE_OBJECT FileObject
Definition: vfat.h:585
ULONG FatType
Definition: vfat.h:264
PVFATFCB vfatOpenRootFCB(PDEVICE_EXTENSION pVCB)
Definition: fcb.c:708
unsigned long FileSize
Definition: vfat.h:175
NTSTATUS(* PWRITE_CLUSTER)(PDEVICE_EXTENSION, ULONG, ULONG, PULONG)
Definition: vfat.h:287
struct _HASHENTRY HASHENTRY
NTSTATUS VfatReadDisk(IN PDEVICE_OBJECT pDeviceObject, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, IN PUCHAR Buffer, IN BOOLEAN Override)
unsigned char OEMName[8]
Definition: vfat.h:60
ULONG vfatDirEntryGetFirstCluster(PDEVICE_EXTENSION pDeviceExt, PDIR_ENTRY pDirEntry)
Definition: direntry.c:19
CHAR InputBuffer[80]
Definition: conmgr.c:33
FAT_STATISTICS Fat
Definition: vfat.h:307
NTSTATUS VfatFlush(PVFAT_IRP_CONTEXT IrpContext)
Definition: flush.c:149
unsigned char Res2[448]
Definition: vfat.h:53
struct VFAT_GLOBAL_DATA * PVFAT_GLOBAL_DATA
unsigned char SectorsPerCluster
Definition: vfat.h:43
PVPB IoVPB
Definition: vfat.h:352
NTSTATUS(* PGET_DIRTY_STATUS)(PDEVICE_EXTENSION, PBOOLEAN)
Definition: vfat.h:293
ULONG RefCount
Definition: vfat.h:586
unsigned short Offset
Definition: vfat.h:148
DRIVER_DISPATCH VfatBuildRequest
Definition: vfat.h:1141
struct _VFAT_MOVE_CONTEXT VFAT_MOVE_CONTEXT
NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: finfo.c:1430
unsigned short Unknown[15]
Definition: vfat.h:139
LONG RefCount
Definition: vfat.h:475
unsigned char ShortName[11]
Definition: vfat.h:115
unsigned short Heads
Definition: vfat.h:67
ULONG Sectors
Definition: vfat.h:265
PVFATFCB vfatNewFCB(PDEVICE_EXTENSION pVCB, PUNICODE_STRING pFileNameU)
Definition: fcb.c:129
WCHAR First[]
Definition: FormatMessage.c:11
struct DEVICE_EXTENSION DEVICE_EXTENSION
VFAT_DISPATCH Dispatch
Definition: vfat.h:356
unsigned int EALength
Definition: vfat.h:152
NTSTATUS VfatSetExtendedAttributes(PFILE_OBJECT FileObject, PVOID Ea, ULONG EaLength)
Definition: ea.c:36
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
struct _VFAT_DISPATCH VFAT_DISPATCH
ULONG AvailableClusters
Definition: vfat.h:326
CCHAR PriorityBoost
Definition: vfat.h:588
NTSTATUS FAT16SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1042
BOOLEAN NTAPI VfatAcquireForLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.c:728
FORCEINLINE BOOLEAN vfatFCBIsReadOnly(PVFATFCB FCB)
Definition: vfat.h:638
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned char Attrib
Definition: vfat.h:117
NTSTATUS FAT16WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue, PULONG OldValue)
Definition: fat.c:619
LIST_ENTRY VolumeListEntry
Definition: vfat.h:342
NTSTATUS VfatPnp(PVFAT_IRP_CONTEXT IrpContext)
Definition: pnp.c:20
LARGE_INTEGER CurrentByteOffset
Definition: vfat.h:532
NTSTATUS vfatMakeFCBFromDirEntry(PVCB vcb, PVFATFCB directoryFCB, PVFAT_DIRENTRY_CONTEXT DirContext, PVFATFCB *fileFCB)
Definition: fcb.c:725
unsigned char FATCount
Definition: vfat.h:64
unsigned short AccessDate
Definition: vfat.h:120
long LONG
Definition: pedump.c:60
struct DEVICE_EXTENSION VCB
_In_ ULONG BufferLength
Definition: usbdlib.h:225
ULONG FATSectors
Definition: vfat.h:255
struct _VFAT_DIRENTRY_CONTEXT VFAT_DIRENTRY_CONTEXT
NTSTATUS(* PGET_NEXT_DIR_ENTRY)(PVOID *, PVOID *, struct _VFATFCB *, struct _VFAT_DIRENTRY_CONTEXT *, BOOLEAN)
Definition: vfat.h:292
PDEVICE_EXTENSION Vcb
Definition: vfat.h:612
unsigned short Signatur1
Definition: vfat.h:54
ULONG Flags
Definition: vfat.h:533
#define STATISTICS_SIZE_NO_PAD
Definition: vfat.h:304
unsigned short EASetTable[240]
Definition: vfat.h:140
FATINFO FatInfo
Definition: vfat.h:324
PFILE_OBJECT FileObject
Definition: vfat.h:493
unsigned long FATSectors32
Definition: vfat.h:69
PWRITE_CLUSTER WriteCluster
Definition: vfat.h:336
ULONG Flags
Definition: vfat.h:490
SHARE_ACCESS FCBShareAccess
Definition: vfat.h:502
unsigned short ReservedSectors
Definition: vfat.h:63
#define IRPCONTEXT_QUEUE
Definition: vfat.h:571
KEVENT Event
Definition: vfat.h:587
ULONG FirstCluster
Definition: vfat.h:603
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
unsigned short CreationDate
Definition: vfat.h:179
VOID vfatGrabFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
Definition: fcb.c:302
struct _STATISTICS * PSTATISTICS
#define FORCEINLINE
Definition: ntbasedef.h:221
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
PVFATFCB vfatGrabFCBFromTable(PDEVICE_EXTENSION pDeviceExt, PUNICODE_STRING pFileNameU)
Definition: fcb.c:594
ULONG NumberProcessors
Definition: vfat.h:408
VOID vfat8Dot3ToString(PFAT_DIR_ENTRY pEntry, PUNICODE_STRING NameU)
Definition: create.c:37
Definition: bufpool.h:45
unsigned long RootCluster
Definition: vfat.h:72
unsigned short Signature
Definition: vfat.h:138
ULONG VolumeID
Definition: vfat.h:251
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
ULONG OpenHandleCount
Definition: vfat.h:349
NTSTATUS VfatCreate(PVFAT_IRP_CONTEXT IrpContext)
Definition: create.c:1083
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
KSPIN_LOCK FcbListLock
Definition: vfat.h:316
NTSTATUS vfatRenameEntry(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB pFcb, IN PUNICODE_STRING FileName, IN BOOLEAN CaseChangeOnly)
Definition: dirwr.c:180
struct _VFAT_MOVE_CONTEXT * PVFAT_MOVE_CONTEXT
BOOLEAN FsdSystemTimeToDosDateTime(PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, USHORT *pDosDate, USHORT *pDosTime)
Definition: dir.c:53
unsigned char Media
Definition: vfat.h:47
NTSTATUS FAT16GetDirtyStatus(PDEVICE_EXTENSION DeviceExt, PBOOLEAN DirtyStatus)
Definition: fat.c:856
NTSTATUS vfatUpdateFCB(PDEVICE_EXTENSION pVCB, PVFATFCB Fcb, PVFAT_DIRENTRY_CONTEXT DirContext, PVFATFCB ParentFcb)
Definition: fcb.c:538
NPAGED_LOOKASIDE_LIST CcbLookasideList
Definition: vfat.h:412
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
NTSTATUS VfatWriteDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN ULONG BufferOffset, IN BOOLEAN Wait)
Definition: blockdev.c:336
struct _VFAT_CLOSE_CONTEXT * PVFAT_CLOSE_CONTEXT
ULONG startIndex
Definition: vfat.h:499
PGET_NEXT_DIR_ENTRY GetNextDirEntry
Definition: vfat.h:301
NTSTATUS VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, PVFATFCB Fcb, PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER AllocationSize)
Definition: finfo.c:1207
PADD_ENTRY AddEntry
Definition: vfat.h:299
FORCEINLINE BOOLEAN vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt)
Definition: vfat.h:645
FAST_MUTEX
Definition: extypes.h:17
ULONG Flags
Definition: vfat.h:328
unsigned short BootBackup
Definition: vfat.h:74
PGET_NEXT_CLUSTER GetNextCluster
Definition: vfat.h:334
PSTATISTICS Statistics
Definition: vfat.h:331
ULONG LastOffset
Definition: vfat.h:523
unsigned short CreationDate
Definition: vfat.h:120
ERESOURCE FatResource
Definition: vfat.h:314
PDEVICE_OBJECT DeviceObject
Definition: vfat.h:406
ERESOURCE DirResource
Definition: vfat.h:313
USHORT Month
Definition: vfat.h:564
NTSTATUS GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:742
unsigned short FATCount
Definition: vfat.h:92
ULONG BaseDateYear
Definition: vfat.h:340
IN PVCB IN PDIRENT OUT PULONG EaLength
Definition: fatprocs.h:866
struct _VFATFCB * parentFcb
Definition: vfat.h:484
NTSTATUS(* PADD_ENTRY)(PDEVICE_EXTENSION, PUNICODE_STRING, struct _VFATFCB **, struct _VFATFCB *, ULONG, UCHAR, struct _VFAT_MOVE_CONTEXT *)
Definition: vfat.h:290
union _DIR_ENTRY * PDIR_ENTRY
Definition: vfat.h:230
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG FilterMatch
Definition: fsrtlfuncs.h:738
unsigned short Unknown2[3]
Definition: vfat.h:151
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define STATUS_PENDING
Definition: ntstatus.h:82
unsigned short SectorsPerTrack
Definition: vfat.h:48
NTSTATUS VfatDirectoryControl(PVFAT_IRP_CONTEXT IrpContext)
Definition: dir.c:728
UNICODE_STRING ShortNameU
Definition: vfat.h:597
char CCHAR
Definition: typedefs.h:50
unsigned char FATCount
Definition: vfat.h:45
NTSTATUS FAT32WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue, PULONG OldValue)
Definition: fat.c:659
uint64_t ULONGLONG
Definition: typedefs.h:65
struct _EAFileHeader * PFAT_EA_FILE_HEADER
Definition: vfat.h:134
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
ULONG BytesPerCluster
Definition: vfat.h:262
VOID vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
Definition: fcb.c:336
FORCEINLINE NTSTATUS VfatAddEntry(PDEVICE_EXTENSION DeviceExt, PUNICODE_STRING NameU, struct _VFATFCB **Fcb, struct _VFATFCB *ParentFcb, ULONG RequestedOptions, UCHAR ReqAttr, struct _VFAT_MOVE_CONTEXT *MoveContext)
Definition: vfat.h:369
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
Definition: cdprocs.h:429
const GLubyte * c
Definition: glext.h:8905
struct DEVICE_EXTENSION * PVCB
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
DIR_ENTRY DirEntry
Definition: vfat.h:595
FORCEINLINE NTSTATUS VfatMarkIrpContextForQueue(PVFAT_IRP_CONTEXT IrpContext)
Definition: vfat.h:619
INIT_FUNCTION NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
Definition: battc.c:16
PDEL_ENTRY DelEntry
Definition: vfat.h:300
char TargetFileName[12]
Definition: vfat.h:150
unsigned long VolumeID
Definition: vfat.h:79
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
USHORT Day
Definition: vfat.h:563
NTSTATUS VfatClose(PVFAT_IRP_CONTEXT IrpContext)
Definition: close.c:213
unsigned char magic1
Definition: vfat.h:59
* PFILE_OBJECT
Definition: iotypes.h:1955
struct _HASHENTRY * next
Definition: vfat.h:279
_In_ PFCB ParentFcb
Definition: cdprocs.h:741
FSRTL_COMMON_FCB_HEADER RFCB
Definition: vfat.h:444
unsigned char Res7[12]
Definition: vfat.h:104
FILE_LOCK FileLock
Definition: vfat.h:514
Definition: ncftp.h:79
FATX_DIR_ENTRY FatX
Definition: vfat.h:227
NTSTATUS NextCluster(PDEVICE_EXTENSION DeviceExt, ULONG FirstCluster, PULONG CurrentCluster, BOOLEAN Extend)
Definition: rw.c:40
unsigned long FSINFOSignature
Definition: vfat.h:101
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
FORCEINLINE BOOLEAN VfatIsDirectoryEmpty(PDEVICE_EXTENSION DeviceExt, struct _VFATFCB *Fcb)
Definition: vfat.h:361
#define VCB_IS_FATX
Definition: vfat.h:242
ULONG BytesPerSector
Definition: vfat.h:261
unsigned short BytesPerSector
Definition: vfat.h:61
unsigned char Res1
Definition: vfat.h:50
#define NTSTATUS
Definition: precomp.h:20
PWCHAR PathNameBuffer
Definition: vfat.h:469
WCHAR name5_10[6]
Definition: vfat.h:191
ULONG Hash
Definition: vfat.h:277
NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb)
Definition: flush.c:51
ULONG dataStart
Definition: vfat.h:258
ULONG rootDirectorySectors
Definition: vfat.h:256
FORCEINLINE NTSTATUS VfatGetNextDirEntry(PDEVICE_EXTENSION DeviceExt, PVOID *pContext, PVOID *pPage, struct _VFATFCB *pDirFcb, struct _VFAT_DIRENTRY_CONTEXT *DirContext, BOOLEAN First)
Definition: vfat.h:391
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)
Definition: blockdev.c:432
UCHAR MinorFunction
Definition: vfat.h:584
BOOLEAN InPlace
Definition: vfat.h:607
NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: volume.c:509
struct __DOSTIME DOSTIME
Definition: typedefs.h:117
NTSTATUS GetDirtyStatus(PDEVICE_EXTENSION DeviceExt, PBOOLEAN DirtyStatus)
Definition: fat.c:829
unsigned char Res3[12]
Definition: vfat.h:75
NTSTATUS VfatCloseFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
Definition: close.c:160
struct _VFATFCB * VolumeFcb
Definition: vfat.h:329
DRIVER_DISPATCH(nfs41_FsdDispatch)
unsigned short FirstClusterHigh
Definition: vfat.h:123
NTSTATUS FAT32UpdateFreeClustersCount(PDEVICE_EXTENSION DeviceExt)
Definition: fat.c:1213
struct _VFATFCB * PVFATFCB
NTSTATUS VfatWrite(PVFAT_IRP_CONTEXT IrpContext)
Definition: rw.c:875
NTSTATUS vfatFCBInitializeCacheFromVolume(PVCB vcb, PVFATFCB fcb)
Definition: dirwr.c:24
Definition: vfat.h:184
UNICODE_STRING DirNameU
Definition: vfat.h:463
unsigned short FATSectors
Definition: vfat.h:48
unsigned short Heads
Definition: vfat.h:48
struct _VFAT_CLOSE_CONTEXT * CloseContext
Definition: vfat.h:525
PFIND_AND_MARK_AVAILABLE_CLUSTER FindAndMarkAvailableCluster
Definition: vfat.h:335
USHORT Year
Definition: vfat.h:565
Definition: vfat.h:249
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:310
CACHE_MANAGER_CALLBACKS CacheMgrCallbacks
Definition: vfat.h:416
NTSTATUS VfatSetInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: finfo.c:1557
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
unsigned long SectorsHuge
Definition: vfat.h:68
DIR_ENTRY entry
Definition: vfat.h:451
unsigned short Signature
Definition: vfat.h:147
unsigned short FSVersion
Definition: vfat.h:71
WCHAR name11_12[2]
Definition: vfat.h:193
ULONG FATCount
Definition: vfat.h:254
struct __DOSDATE * PDOSDATE
PUCHAR Attributes
Definition: vfat.h:454
HASHENTRY ShortHash
Definition: vfat.h:511
ERESOURCE PagingIoResource
Definition: vfat.h:447
struct _FATDirEntry * PFAT_DIR_ENTRY
Definition: vfat.h:167
FORCEINLINE VOID vfatReportChange(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB Fcb, IN ULONG FilterMatch, IN ULONG Action)
Definition: vfat.h:652
unsigned short RootEntries
Definition: vfat.h:65
NTSTATUS GetNextClusterExtend(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:771
NTSTATUS VfatGetStandardInformation(PVFATFCB FCB, PFILE_STANDARD_INFORMATION StandardInfo, PULONG BufferLength)
Definition: finfo.c:75
unsigned char reserved
Definition: vfat.h:189
unsigned long FreeCluster
Definition: vfat.h:102
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
enum _LOCK_OPERATION LOCK_OPERATION
unsigned char Filename[42]
Definition: vfat.h:173
BOOLEAN ShutdownStarted
Definition: vfat.h:422
VOID NTAPI VfatHandleDeferredWrite(IN PVOID IrpContext, IN PVOID Unused)
Definition: misc.c:218
PGET_DIRTY_STATUS GetDirtyStatus
Definition: vfat.h:337
unsigned short USHORT
Definition: pedump.c:61
FORCEINLINE NTSTATUS VfatDelEntry(PDEVICE_EXTENSION DeviceExt, struct _VFATFCB *Fcb, struct _VFAT_MOVE_CONTEXT *MoveContext)
Definition: vfat.h:382
void(* Func)(int)
GLuint start
Definition: gl.h:1545
unsigned char id
Definition: vfat.h:186
BOOLEAN VfatCheckForDismount(IN PDEVICE_EXTENSION DeviceExt, IN BOOLEAN Create)
Definition: misc.c:417
unsigned char SysType[4]
Definition: vfat.h:89
ULONG NumberOfClusters
Definition: vfat.h:263
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:151
unsigned char SysType[8]
Definition: vfat.h:80
NTSTATUS VfatGetBasicInformation(PFILE_OBJECT FileObject, PVFATFCB FCB, PDEVICE_EXTENSION DeviceExt, PFILE_BASIC_INFORMATION BasicInfo, PULONG BufferLength)
Definition: finfo.c:282
unsigned long ExtBootSignature2
Definition: vfat.h:99
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
unsigned char lCase
Definition: vfat.h:118
struct _HASHENTRY ** FcbHashTable
Definition: vfat.h:319
PDEVICE_OBJECT VolumeDevice
Definition: vfat.h:321
unsigned short Sectors
Definition: vfat.h:65
unsigned char Drive
Definition: vfat.h:76
unsigned int * PULONG
Definition: retypes.h:1
NTSTATUS VfatMoveEntry(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB pFcb, IN PUNICODE_STRING FileName, IN PVFATFCB ParentFcb)
Definition: dirwr.c:1124
ULONG FileSize
Definition: vfat.h:604
PDEVICE_OBJECT DeviceObject
Definition: vfat.h:578
Definition: vfat.h:224
NTSTATUS FAT16FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:171
NTSTATUS(* PSET_DIRTY_STATUS)(PDEVICE_EXTENSION, BOOLEAN)
Definition: vfat.h:294
ULONG Flags
Definition: vfat.h:407
LIST_ENTRY NotifyList
Definition: vfat.h:345
LIST_ENTRY CloseListHead
Definition: vfat.h:419
ULONG LastAvailableCluster
Definition: vfat.h:325
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
ERESOURCE MainResource
Definition: vfat.h:446
NTSTATUS VfatLockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
Definition: misc.c:382
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
struct _VFAT_DIRENTRY_CONTEXT * PVFAT_DIRENTRY_CONTEXT
WCHAR name0_4[5]
Definition: vfat.h:187
unsigned short FirstCluster
Definition: vfat.h:128
UCHAR MajorFunction
Definition: vfat.h:583
struct _STATISTICS STATISTICS
BOOLEAN CloseWorkerRunning
Definition: vfat.h:420
unsigned char ExtBootSignature
Definition: vfat.h:78
NTSTATUS FAT32SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1127
ERESOURCE VolumeListLock
Definition: vfat.h:409
unsigned short CreationTime
Definition: vfat.h:178
Definition: iotypes.h:166
#define BOOLEAN
Definition: pedump.c:73
struct _VFAT_CLOSE_CONTEXT VFAT_CLOSE_CONTEXT
#define OUT
Definition: typedefs.h:39
UNICODE_STRING PathNameU
Definition: vfat.h:466
struct _VFATCCB VFATCCB
INIT_FUNCTION VOID VfatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch)
Definition: fastio.c:758
unsigned char Ext[3]
Definition: vfat.h:114
LIST_ENTRY FcbListHead
Definition: vfat.h:317
ULONG CloseCount
Definition: vfat.h:418
ULONG ERESOURCE
Definition: env_spec_w32.h:594
NTSTATUS FAT32GetDirtyStatus(PDEVICE_EXTENSION DeviceExt, PBOOLEAN DirtyStatus)
Definition: fat.c:934
unsigned int ULONG
Definition: retypes.h:1
unsigned short UpdateDate
Definition: vfat.h:127
struct __DOSDATE DOSDATE
FAST_MUTEX LastMutex
Definition: vfat.h:521
NTSTATUS vfatDirFindFile(PDEVICE_EXTENSION pVCB, PVFATFCB parentFCB, PUNICODE_STRING FileToFindU, PVFATFCB *fileFCB)
Definition: fcb.c:791
_In_ FLT_SET_CONTEXT_OPERATION Operation
Definition: fltkernel.h:1468
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
ULONG FSInfoSector
Definition: vfat.h:267
unsigned char OEMName[8]
Definition: vfat.h:41
ULONG Flags
Definition: vfat.h:580
NTSTATUS FAT32GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:30
NTSTATUS WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue)
Definition: fat.c:703
struct _EAHeader * PFAT_EA_HEADER
Definition: vfat.h:156
unsigned char res0
Definition: vfat.h:59
WCHAR ShortNameBuffer[13]
Definition: vfat.h:472
const char * PCSTR
Definition: typedefs.h:51
Definition: File.h:15
unsigned char Media
Definition: vfat.h:66
unsigned short ReservedSectors
Definition: vfat.h:44
USHORT CreationTime
Definition: vfat.h:606
unsigned short AccessDate
Definition: vfat.h:181
HASHENTRY Hash
Definition: vfat.h:508
NTSTATUS vfatGetFCBForFile(PDEVICE_EXTENSION pVCB, PVFATFCB *pParentFCB, PVFATFCB *pFCB, PUNICODE_STRING pFileNameU)
Definition: fcb.c:884
unsigned short SectorsPerTrack
Definition: vfat.h:67
PDEVICE_EXTENSION DeviceExt
Definition: vfat.h:598
PVPB SpareVPB
Definition: vfat.h:353
_In_ PFCB Fcb
Definition: cdprocs.h:151
ULONG OpenHandleCount
Definition: vfat.h:505
NTSTATUS FAT32FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:310
PIO_STACK_LOCATION Stack
Definition: vfat.h:582
unsigned short UpdateTime
Definition: vfat.h:176
unsigned char res0
Definition: vfat.h:40
USHORT Minute
Definition: vfat.h:556
unsigned char Res2[420]
Definition: vfat.h:81
LIST_ENTRY ParentListHead
Definition: vfat.h:487
USHORT Second
Definition: vfat.h:555
ULONG RootCluster
Definition: vfat.h:259
PNOTIFY_SYNC NotifySync
Definition: vfat.h:346
NTSTATUS VfatFileSystemControl(PVFAT_IRP_CONTEXT IrpContext)
Definition: fsctl.c:1390
struct _VFAT_DISPATCH * PVFAT_DISPATCH
struct _VFATFCB * RootFcb
Definition: vfat.h:330
unsigned long NextCluster
Definition: vfat.h:103
PAGED_LOOKASIDE_LIST CloseContextLookasideList
Definition: vfat.h:414
USHORT CreationDate
Definition: vfat.h:605
unsigned char Attrib
Definition: vfat.h:172
unsigned short RootEntries
Definition: vfat.h:46
DRIVER_DISPATCH VfatShutdown
Definition: vfat.h:1204
unsigned char Res6[480]
Definition: vfat.h:100
WORK_QUEUE_ITEM WorkQueueItem
Definition: vfat.h:581
NTSTATUS(* PGET_NEXT_CLUSTER)(PDEVICE_EXTENSION, ULONG, PULONG)
Definition: vfat.h:285
BOOLEAN vfatFindDirSpace(PDEVICE_EXTENSION DeviceExt, PVFATFCB pDirFcb, ULONG nbSlots, PULONG start)
BOOLEAN(* PIS_DIRECTORY_EMPTY)(PDEVICE_EXTENSION, struct _VFATFCB *)
Definition: vfat.h:289
NTSTATUS SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1015
unsigned short Signature1
Definition: vfat.h:82
ULONG HashTableSize
Definition: vfat.h:318
unsigned char VolumeLabel[11]
Definition: vfat.h:52
LIST_ENTRY ParentListEntry
Definition: vfat.h:481
NTSTATUS VfatReadDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, IN ULONG BufferOffset, IN BOOLEAN Wait)
IN BOOLEAN Wait
Definition: fatprocs.h:1529
unsigned long Unknown
Definition: vfat.h:93
VOID vfatDestroyCCB(PVFATCCB pCcb)
Definition: fcb.c:258
PVFATFCB Fcb
Definition: vfat.h:613