ReactOS  0.4.15-dev-1201-gb2cf5a4
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  /* Overflow request queue */
338 
339  /* Pointers to functions for manipulating FAT. */
345 
347 
349 
350  /* Notifications */
353 
354  /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLOSE */
356 
357  /* VPBs for dismount */
360 
361  /* Pointers to functions for manipulating directory entries. */
364 
366 BOOLEAN
368  struct _VFATFCB* Fcb)
369 {
370  return DeviceExt->Dispatch.IsDirectoryEmpty(DeviceExt, Fcb);
371 }
372 
374 NTSTATUS
376  PUNICODE_STRING NameU,
377  struct _VFATFCB** Fcb,
378  struct _VFATFCB* ParentFcb,
379  ULONG RequestedOptions,
380  UCHAR ReqAttr,
381  struct _VFAT_MOVE_CONTEXT* MoveContext)
382 {
383  return DeviceExt->Dispatch.AddEntry(DeviceExt, NameU, Fcb, ParentFcb, RequestedOptions, ReqAttr, MoveContext);
384 }
385 
387 NTSTATUS
389  struct _VFATFCB* Fcb,
390  struct _VFAT_MOVE_CONTEXT* MoveContext)
391 {
392  return DeviceExt->Dispatch.DelEntry(DeviceExt, Fcb, MoveContext);
393 }
394 
396 NTSTATUS
398  PVOID *pContext,
399  PVOID *pPage,
400  struct _VFATFCB* pDirFcb,
402  BOOLEAN First)
403 {
404  return DeviceExt->Dispatch.GetNextDirEntry(pContext, pPage, pDirFcb, DirContext, First);
405 }
406 
407 #define VFAT_BREAK_ON_CORRUPTION 1
408 
409 typedef struct
410 {
430 
432 
433 #define FCB_CACHE_INITIALIZED 0x0001
434 #define FCB_DELETE_PENDING 0x0002
435 #define FCB_IS_FAT 0x0004
436 #define FCB_IS_PAGE_FILE 0x0008
437 #define FCB_IS_VOLUME 0x0010
438 #define FCB_IS_DIRTY 0x0020
439 #define FCB_DELAYED_CLOSE 0x0040
440 #ifdef KDBG
441 #define FCB_CLEANED_UP 0x0080
442 #define FCB_CLOSED 0x0100
443 #endif
444 
445 #define NODE_TYPE_FCB ((CSHORT)0x0502)
446 
447 typedef struct _VFATFCB
448 {
449  /* FCB header required by ROS/NT */
454  /* end FCB header required by ROS/NT */
455 
456  /* directory entry for this file or directory */
458 
459  /* Pointer to attributes in entry */
461 
462  /* long file name, points into PathNameBuffer */
464 
465  /* short file name */
467 
468  /* directory name, points into PathNameBuffer */
470 
471  /* path + long file name 260 max*/
473 
474  /* buffer for PathNameU */
476 
477  /* buffer for ShortNameU */
479 
480  /* */
482 
483  /* List of FCB's for this volume */
485 
486  /* List of FCB's for the parent */
488 
489  /* pointer to the parent fcb */
491 
492  /* List for the children */
494 
495  /* Flags for the fcb */
497 
498  /* pointer to the file object which has initialized the fcb */
500 
501  /* Directory index for the short name entry */
503 
504  /* Directory index where the long name starts */
506 
507  /* Share access for the file object */
509 
510  /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
512 
513  /* Entry into the hash table for the path + long name */
515 
516  /* Entry into the hash table for the path + short name */
518 
519  /* List of byte-range locks for this file */
521 
522  /*
523  * Optimization: caching of last read/write cluster+offset pair. Can't
524  * be in VFATCCB because it must be reset everytime the allocated clusters
525  * change.
526  */
530 
532 } VFATFCB, *PVFATFCB;
533 
534 #define CCB_DELETE_ON_CLOSE 0x0001
535 
536 typedef struct _VFATCCB
537 {
540  /* for DirectoryControl */
542  /* for DirectoryControl */
544 } VFATCCB, *PVFATCCB;
545 
546 #define TAG_CCB 'CtaF'
547 #define TAG_FCB 'FtaF'
548 #define TAG_IRP 'ItaF'
549 #define TAG_CLOSE 'xtaF'
550 #define TAG_STATS 'VtaF'
551 #define TAG_BUFFER 'OtaF'
552 #define TAG_VPB 'vtaF'
553 #define TAG_NAME 'ntaF'
554 #define TAG_SEARCH 'LtaF'
555 #define TAG_DIRENT 'DtaF'
556 
557 #define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))
558 
559 typedef struct __DOSTIME
560 {
564 }
565 DOSTIME, *PDOSTIME;
566 
567 typedef struct __DOSDATE
568 {
572 }
573 DOSDATE, *PDOSDATE;
574 
575 #define IRPCONTEXT_CANWAIT 0x0001
576 #define IRPCONTEXT_COMPLETE 0x0002
577 #define IRPCONTEXT_QUEUE 0x0004
578 #define IRPCONTEXT_PENDINGRETURNED 0x0008
579 #define IRPCONTEXT_DEFERRED_WRITE 0x0010
580 
581 typedef struct
582 {
596 
598 {
606 
607 typedef struct _VFAT_MOVE_CONTEXT
608 {
615 
616 typedef struct _VFAT_CLOSE_CONTEXT
617 {
622 
624 NTSTATUS
626 {
627  PULONG Flags = &IrpContext->Flags;
628 
631 
632  return STATUS_PENDING;
633 }
634 
636 BOOLEAN
638 {
639  return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_DIRECTORY);
640 }
641 
643 BOOLEAN
645 {
646  return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_READONLY);
647 }
648 
650 BOOLEAN
652 {
653  return BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX);
654 }
655 
657 VOID
659  IN PDEVICE_EXTENSION DeviceExt,
660  IN PVFATFCB Fcb,
662  IN ULONG Action)
663 {
664  FsRtlNotifyFullReportChange(DeviceExt->NotifySync,
665  &(DeviceExt->NotifyList),
666  (PSTRING)&Fcb->PathNameU,
667  Fcb->PathNameU.Length - Fcb->LongNameU.Length,
669 }
670 
671 #define vfatAddToStat(Vcb, Stat, Inc) \
672 { \
673  PSTATISTICS Stats = &(Vcb)->Statistics[KeGetCurrentProcessorNumber() % VfatGlobalData->NumberProcessors]; \
674  Stats->Stat += Inc; \
675 }
676 
677 /* blockdev.c */
678 
679 NTSTATUS
682  IN PLARGE_INTEGER ReadOffset,
683  IN ULONG ReadLength,
684  IN PUCHAR Buffer,
685  IN BOOLEAN Override);
686 
687 NTSTATUS
689  IN PVFAT_IRP_CONTEXT IrpContext,
690  IN PLARGE_INTEGER ReadOffset,
691  IN ULONG ReadLength,
692  IN ULONG BufferOffset,
693  IN BOOLEAN Wait);
694 
695 NTSTATUS
698  IN PLARGE_INTEGER WriteOffset,
699  IN ULONG WriteLength,
701  IN BOOLEAN Override);
702 
703 NTSTATUS
705  IN PVFAT_IRP_CONTEXT IrpContext,
706  IN PLARGE_INTEGER WriteOffset,
707  IN ULONG WriteLength,
708  IN ULONG BufferOffset,
709  IN BOOLEAN Wait);
710 
711 NTSTATUS
714  IN ULONG CtlCode,
716  IN ULONG InputBufferSize,
718  IN OUT PULONG pOutputBufferSize,
719  IN BOOLEAN Override);
720 
721 /* cleanup.c */
722 
723 NTSTATUS
725  PVFAT_IRP_CONTEXT IrpContext);
726 
727 /* close.c */
728 
729 NTSTATUS
730 VfatClose(
731  PVFAT_IRP_CONTEXT IrpContext);
732 
733 NTSTATUS
735  PDEVICE_EXTENSION DeviceExt,
737 
738 /* create.c */
739 
740 NTSTATUS
741 VfatCreate(
742  PVFAT_IRP_CONTEXT IrpContext);
743 
744 NTSTATUS
745 FindFile(
746  PDEVICE_EXTENSION DeviceExt,
748  PUNICODE_STRING FileToFindU,
750  BOOLEAN First);
751 
752 VOID
754  PFAT_DIR_ENTRY pEntry,
755  PUNICODE_STRING NameU);
756 
757 /* dir.c */
758 
759 NTSTATUS
761  PVFAT_IRP_CONTEXT IrpContext);
762 
763 BOOLEAN
765  PDEVICE_EXTENSION DeviceExt,
766  USHORT DosDate,
767  USHORT DosTime,
768  PLARGE_INTEGER SystemTime);
769 
770 BOOLEAN
772  PDEVICE_EXTENSION DeviceExt,
773  PLARGE_INTEGER SystemTime,
774  USHORT *pDosDate,
775  USHORT *pDosTime);
776 
777 /* direntry.c */
778 
779 ULONG
781  PDEVICE_EXTENSION pDeviceExt,
782  PDIR_ENTRY pDirEntry);
783 
784 /* dirwr.c */
785 
786 NTSTATUS
788  PVCB vcb,
789  PVFATFCB fcb);
790 
791 NTSTATUS
793  IN PDEVICE_EXTENSION DeviceExt,
794  PVFATFCB pFcb);
795 
796 BOOLEAN
798  PDEVICE_EXTENSION DeviceExt,
799  PVFATFCB pDirFcb,
800  ULONG nbSlots,
801  PULONG start);
802 
803 NTSTATUS
805  IN PDEVICE_EXTENSION DeviceExt,
806  IN PVFATFCB pFcb,
808  IN BOOLEAN CaseChangeOnly);
809 
810 NTSTATUS
812  IN PDEVICE_EXTENSION DeviceExt,
813  IN PVFATFCB pFcb,
816 
817 /* ea.h */
818 
819 NTSTATUS
822  PVOID Ea,
823  ULONG EaLength);
824 
825 /* fastio.c */
826 
827 INIT_FUNCTION
828 VOID
831 
832 BOOLEAN
833 NTAPI
835  IN PVOID Context,
836  IN BOOLEAN Wait);
837 
838 VOID
839 NTAPI
841  IN PVOID Context);
842 
843 /* fat.c */
844 
845 NTSTATUS
847  PDEVICE_EXTENSION DeviceExt,
848  ULONG CurrentCluster,
850 
851 NTSTATUS
853  PDEVICE_EXTENSION DeviceExt,
854  PULONG Cluster);
855 
856 NTSTATUS
858  PDEVICE_EXTENSION DeviceExt,
859  ULONG ClusterToWrite,
860  ULONG NewValue,
861  PULONG OldValue);
862 
863 NTSTATUS
865  PDEVICE_EXTENSION DeviceExt,
866  ULONG CurrentCluster,
868 
869 NTSTATUS
871  PDEVICE_EXTENSION DeviceExt,
872  PULONG Cluster);
873 
874 NTSTATUS
876  PDEVICE_EXTENSION DeviceExt,
877  ULONG ClusterToWrite,
878  ULONG NewValue,
879  PULONG OldValue);
880 
881 NTSTATUS
883  PDEVICE_EXTENSION DeviceExt,
884  ULONG CurrentCluster,
886 
887 NTSTATUS
889  PDEVICE_EXTENSION DeviceExt,
890  PULONG Cluster);
891 
892 NTSTATUS
894  PDEVICE_EXTENSION DeviceExt,
895  ULONG ClusterToWrite,
896  ULONG NewValue,
897  PULONG OldValue);
898 
899 NTSTATUS
901  PDEVICE_EXTENSION DeviceExt,
902  ULONG FirstCluster,
904  PULONG Cluster,
905  BOOLEAN Extend);
906 
907 ULONGLONG
909  PDEVICE_EXTENSION DeviceExt,
910  ULONG Cluster);
911 
912 NTSTATUS
914  PDEVICE_EXTENSION DeviceExt,
915  ULONG CurrentCluster,
917 
918 NTSTATUS
920  PDEVICE_EXTENSION DeviceExt,
921  ULONG CurrentCluster,
923 
924 NTSTATUS
926  PDEVICE_EXTENSION DeviceExt,
927  PLARGE_INTEGER Clusters);
928 
929 NTSTATUS
931  PDEVICE_EXTENSION DeviceExt,
932  ULONG ClusterToWrite,
933  ULONG NewValue);
934 
935 NTSTATUS
937  PDEVICE_EXTENSION DeviceExt,
938  PBOOLEAN DirtyStatus);
939 
940 NTSTATUS
942  PDEVICE_EXTENSION DeviceExt,
943  PBOOLEAN DirtyStatus);
944 
945 NTSTATUS
947  PDEVICE_EXTENSION DeviceExt,
948  PBOOLEAN DirtyStatus);
949 
950 NTSTATUS
952  PDEVICE_EXTENSION DeviceExt,
953  BOOLEAN DirtyStatus);
954 
955 NTSTATUS
957  PDEVICE_EXTENSION DeviceExt,
958  BOOLEAN DirtyStatus);
959 
960 NTSTATUS
962  PDEVICE_EXTENSION DeviceExt,
963  BOOLEAN DirtyStatus);
964 
965 NTSTATUS
967  PDEVICE_EXTENSION DeviceExt);
968 
969 /* fcb.c */
970 
971 PVFATFCB
972 vfatNewFCB(
973  PDEVICE_EXTENSION pVCB,
974  PUNICODE_STRING pFileNameU);
975 
976 NTSTATUS
978  PDEVICE_EXTENSION pVCB,
979  PVFATFCB Fcb,
981 
982 NTSTATUS
984  PDEVICE_EXTENSION pVCB,
985  PVFATFCB Fcb,
988 
989 VOID
991  PVFATFCB pFCB);
992 
993 VOID
995  PVFATCCB pCcb);
996 
997 VOID
998 #ifndef KDBG
1000 #else
1001 _vfatGrabFCB(
1002 #endif
1003  PDEVICE_EXTENSION pVCB,
1004  PVFATFCB pFCB
1005 #ifdef KDBG
1006  ,
1007  PCSTR File,
1008  ULONG Line,
1009  PCSTR Func
1010 #endif
1011  );
1012 
1013 VOID
1014 #ifndef KDBG
1016 #else
1017 _vfatReleaseFCB(
1018 #endif
1019  PDEVICE_EXTENSION pVCB,
1020  PVFATFCB pFCB
1021 #ifdef KDBG
1022  ,
1023  PCSTR File,
1024  ULONG Line,
1025  PCSTR Func
1026 #endif
1027  );
1028 
1029 #ifdef KDBG
1030 #define vfatGrabFCB(v, f) _vfatGrabFCB(v, f, __FILE__, __LINE__, __FUNCTION__)
1031 #define vfatReleaseFCB(v, f) _vfatReleaseFCB(v, f, __FILE__, __LINE__, __FUNCTION__)
1032 #endif
1033 
1034 PVFATFCB
1036  PDEVICE_EXTENSION pDeviceExt,
1037  PUNICODE_STRING pFileNameU);
1038 
1039 PVFATFCB
1041  PDEVICE_EXTENSION pVCB);
1042 
1043 PVFATFCB
1045  PDEVICE_EXTENSION pVCB);
1046 
1047 BOOLEAN
1049  PVFATFCB FCB);
1050 
1051 BOOLEAN
1053  PVFATFCB FCB);
1054 
1055 NTSTATUS
1057  PDEVICE_EXTENSION vcb,
1058  PVFATFCB fcb,
1059  PFILE_OBJECT fileObject);
1060 
1061 NTSTATUS
1063  PDEVICE_EXTENSION pVCB,
1064  PVFATFCB parentFCB,
1065  PUNICODE_STRING FileToFindU,
1066  PVFATFCB *fileFCB);
1067 
1068 NTSTATUS
1070  PDEVICE_EXTENSION pVCB,
1071  PVFATFCB *pParentFCB,
1072  PVFATFCB *pFCB,
1073  PUNICODE_STRING pFileNameU);
1074 
1075 NTSTATUS
1077  PVCB vcb,
1078  PVFATFCB directoryFCB,
1080  PVFATFCB *fileFCB);
1081 
1082 /* finfo.c */
1083 
1084 NTSTATUS
1086  PVFATFCB FCB,
1087  PFILE_STANDARD_INFORMATION StandardInfo,
1089 
1090 NTSTATUS
1093  PVFATFCB FCB,
1094  PDEVICE_EXTENSION DeviceExt,
1095  PFILE_BASIC_INFORMATION BasicInfo,
1097 
1098 NTSTATUS
1100  PVFAT_IRP_CONTEXT IrpContext);
1101 
1102 NTSTATUS
1104  PVFAT_IRP_CONTEXT IrpContext);
1105 
1106 NTSTATUS
1109  PVFATFCB Fcb,
1110  PDEVICE_EXTENSION DeviceExt,
1112 
1113 /* flush.c */
1114 
1115 NTSTATUS
1116 VfatFlush(
1117  PVFAT_IRP_CONTEXT IrpContext);
1118 
1119 NTSTATUS
1121  PDEVICE_EXTENSION DeviceExt,
1122  PVFATFCB VolumeFcb);
1123 
1124 /* fsctl.c */
1125 
1126 NTSTATUS
1128  PVFAT_IRP_CONTEXT IrpContext);
1129 
1130 /* iface.c */
1131 
1132 INIT_FUNCTION
1133 NTSTATUS
1134 NTAPI
1135 DriverEntry(
1138 
1139 #ifdef KDBG
1140 /* kdbg.c */
1141 KDBG_CLI_ROUTINE vfatKdbgHandler;
1142 #endif
1143 
1144 /* misc.c */
1145 
1148 
1149 NTSTATUS
1150 NTAPI
1153  PIRP Irp);
1154 
1155 PVOID
1157  IN PIRP Irp,
1158  IN BOOLEAN Paging);
1159 
1160 NTSTATUS
1162  IN PIRP Irp,
1163  IN ULONG Length,
1165 
1166 BOOLEAN
1168  IN PDEVICE_EXTENSION DeviceExt,
1169  IN BOOLEAN Create);
1170 
1171 VOID
1173  IN PDEVICE_EXTENSION DeviceExt,
1174  IN PVFATFCB Fcb,
1176  IN ULONG Action);
1177 
1178 VOID
1179 NTAPI
1181  IN PVOID IrpContext,
1182  IN PVOID Unused);
1183 
1184 /* pnp.c */
1185 
1186 NTSTATUS
1187 VfatPnp(
1188  PVFAT_IRP_CONTEXT IrpContext);
1189 
1190 /* rw.c */
1191 
1192 NTSTATUS
1193 VfatRead(
1194  PVFAT_IRP_CONTEXT IrpContext);
1195 
1196 NTSTATUS
1197 VfatWrite(
1198  PVFAT_IRP_CONTEXT *pIrpContext);
1199 
1200 NTSTATUS
1201 NextCluster(
1202  PDEVICE_EXTENSION DeviceExt,
1203  ULONG FirstCluster,
1204  PULONG CurrentCluster,
1205  BOOLEAN Extend);
1206 
1207 /* shutdown.c */
1208 
1211 
1212 NTSTATUS
1213 NTAPI
1214 VfatShutdown(
1216  PIRP Irp);
1217 
1218 /* string.c */
1219 
1220 VOID
1222  PUNICODE_STRING PathNameU,
1223  PUNICODE_STRING DirNameU,
1224  PUNICODE_STRING FileNameU);
1225 
1226 BOOLEAN
1228  WCHAR c);
1229 
1230 BOOLEAN
1233 
1234 /* volume.c */
1235 
1236 NTSTATUS
1238  PVFAT_IRP_CONTEXT IrpContext);
1239 
1240 NTSTATUS
1242  PVFAT_IRP_CONTEXT IrpContext);
1243 
1244 #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:620
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:1149
unsigned char Unused[4078]
Definition: vfat.h:94
#define IN
Definition: typedefs.h:39
_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:451
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:484
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:416
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:444
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:423
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG BufferLength
Definition: cdrom.h:989
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:466
NTSTATUS VfatRead(PVFAT_IRP_CONTEXT IrpContext)
Definition: rw.c:710
Definition: vfat.h:447
BOOLEAN vfatIsLongIllegal(WCHAR c)
Definition: string.c:23
BOOLEAN FixedMedia
Definition: vfat.h:266
#define IRPCONTEXT_COMPLETE
Definition: vfat.h:576
NTSTATUS(* PDEL_ENTRY)(PDEVICE_EXTENSION, struct _VFATFCB *, struct _VFAT_MOVE_CONTEXT *)
Definition: vfat.h:291
ULONG dirIndex
Definition: vfat.h:502
unsigned short Unknown1[2]
Definition: vfat.h:149
Definition: vfat.h:536
PDEVICE_EXTENSION DeviceExt
Definition: vfat.h:585
VOID NTAPI VfatReleaseFromLazyWrite(IN PVOID Context)
Definition: fastio.c:746
PDEVICE_OBJECT StorageDevice
Definition: vfat.h:322
NPAGED_LOOKASIDE_LIST FcbLookasideList
Definition: vfat.h:417
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:528
unsigned short FATSectors
Definition: vfat.h:67
PDRIVER_OBJECT DriverObject
Definition: vfat.h:411
_In_ BOOLEAN Create
Definition: pstypes.h:519
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:427
char CHAR
Definition: xmlstorage.h:175
PSET_DIRTY_STATUS SetDirtyStatus
Definition: vfat.h:344
unsigned char SysType[8]
Definition: vfat.h:52
unsigned short BytesPerSector
Definition: vfat.h:42
UNICODE_STRING LongNameU
Definition: vfat.h:602
KSPIN_LOCK OverflowQueueSpinLock
Definition: vfat.h:334
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:431
FAST_IO_DISPATCH FastIoDispatch
Definition: vfat.h:421
FORCEINLINE BOOLEAN vfatFCBIsDirectory(PVFATFCB FCB)
Definition: vfat.h:637
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:463
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:541
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:543
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:56
unsigned long VolumeID
Definition: vfat.h:51
USHORT Hour
Definition: vfat.h:563
NPAGED_LOOKASIDE_LIST IrpContextLookasideList
Definition: vfat.h:419
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:591
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
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:358
NTSTATUS(* PGET_DIRTY_STATUS)(PDEVICE_EXTENSION, PBOOLEAN)
Definition: vfat.h:293
ULONG RefCount
Definition: vfat.h:592
unsigned short Offset
Definition: vfat.h:148
DRIVER_DISPATCH VfatBuildRequest
Definition: vfat.h:1147
struct _VFAT_MOVE_CONTEXT VFAT_MOVE_CONTEXT
NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: finfo.c:1436
unsigned short Unknown[15]
Definition: vfat.h:139
LONG RefCount
Definition: vfat.h:481
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:362
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:594
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:644
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:348
NTSTATUS VfatPnp(PVFAT_IRP_CONTEXT IrpContext)
Definition: pnp.c:20
LARGE_INTEGER CurrentByteOffset
Definition: vfat.h:538
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
ULONG OverflowQueueCount
Definition: vfat.h:336
long LONG
Definition: pedump.c:60
struct DEVICE_EXTENSION VCB
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:618
unsigned short Signatur1
Definition: vfat.h:54
ULONG Flags
Definition: vfat.h:539
#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:499
unsigned long FATSectors32
Definition: vfat.h:69
PWRITE_CLUSTER WriteCluster
Definition: vfat.h:342
ULONG Flags
Definition: vfat.h:496
SHARE_ACCESS FCBShareAccess
Definition: vfat.h:508
unsigned short ReservedSectors
Definition: vfat.h:63
#define IRPCONTEXT_QUEUE
Definition: vfat.h:577
KEVENT Event
Definition: vfat.h:593
ULONG FirstCluster
Definition: vfat.h:609
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:216
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:414
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
ULONG OpenHandleCount
Definition: vfat.h:355
NTSTATUS VfatCreate(PVFAT_IRP_CONTEXT IrpContext)
Definition: create.c:1088
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:588
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:418
#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:505
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:1213
PADD_ENTRY AddEntry
Definition: vfat.h:299
FORCEINLINE BOOLEAN vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt)
Definition: vfat.h:651
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:340
PSTATISTICS Statistics
Definition: vfat.h:331
ULONG LastOffset
Definition: vfat.h:529
unsigned short CreationDate
Definition: vfat.h:120
ERESOURCE FatResource
Definition: vfat.h:314
PDEVICE_OBJECT DeviceObject
Definition: vfat.h:412
_In_z_ PWSTR RegistryPath
Definition: classp.h:1930
ERESOURCE DirResource
Definition: vfat.h:313
USHORT Month
Definition: vfat.h:570
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:346
IN PVCB IN PDIRENT OUT PULONG EaLength
Definition: fatprocs.h:875
struct _VFATFCB * parentFcb
Definition: vfat.h:490
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:603
char CCHAR
Definition: typedefs.h:51
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:67
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:375
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
Definition: cdprocs.h:424
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:601
FORCEINLINE NTSTATUS VfatMarkIrpContextForQueue(PVFAT_IRP_CONTEXT IrpContext)
Definition: vfat.h:625
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
CHAR InputBuffer[80]
Definition: conmgr.c:33
unsigned long VolumeID
Definition: vfat.h:79
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
USHORT Day
Definition: vfat.h:569
NTSTATUS VfatClose(PVFAT_IRP_CONTEXT IrpContext)
Definition: close.c:213
unsigned char magic1
Definition: vfat.h:59
* PFILE_OBJECT
Definition: iotypes.h:1978
struct _HASHENTRY * next
Definition: vfat.h:279
_In_ PFCB ParentFcb
Definition: cdprocs.h:736
FSRTL_COMMON_FCB_HEADER RFCB
Definition: vfat.h:450
unsigned char Res7[12]
Definition: vfat.h:104
FILE_LOCK FileLock
Definition: vfat.h:520
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:367
#define VCB_IS_FATX
Definition: vfat.h:242
ULONG BytesPerSector
Definition: vfat.h:261
unsigned short BytesPerSector
Definition: vfat.h:61
LIST_ENTRY OverflowQueue
Definition: vfat.h:335
unsigned char Res1
Definition: vfat.h:50
#define NTSTATUS
Definition: precomp.h:20
PWCHAR PathNameBuffer
Definition: vfat.h:475
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:397
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:590
BOOLEAN InPlace
Definition: vfat.h:613
NTSTATUS VfatWrite(PVFAT_IRP_CONTEXT *pIrpContext)
Definition: rw.c:875
NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: volume.c:510
struct __DOSTIME DOSTIME
Definition: typedefs.h:119
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 vfatFCBInitializeCacheFromVolume(PVCB vcb, PVFATFCB fcb)
Definition: dirwr.c:24
Definition: vfat.h:184
UNICODE_STRING DirNameU
Definition: vfat.h:469
unsigned short FATSectors
Definition: vfat.h:48
unsigned short Heads
Definition: vfat.h:48
struct _VFAT_CLOSE_CONTEXT * CloseContext
Definition: vfat.h:531
PFIND_AND_MARK_AVAILABLE_CLUSTER FindAndMarkAvailableCluster
Definition: vfat.h:341
USHORT Year
Definition: vfat.h:571
Definition: vfat.h:249
BOOLEAN IsDotOrDotDot(PCUNICODE_STRING Name)
Definition: string.c:30
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:319
CACHE_MANAGER_CALLBACKS CacheMgrCallbacks
Definition: vfat.h:422
NTSTATUS VfatSetInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: finfo.c:1563
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID OutputBuffer
Definition: cdrom.h:1437
unsigned long SectorsHuge
Definition: vfat.h:68
DIR_ENTRY entry
Definition: vfat.h:457
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:460
HASHENTRY ShortHash
Definition: vfat.h:517
ERESOURCE PagingIoResource
Definition: vfat.h:453
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:658
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:428
VOID NTAPI VfatHandleDeferredWrite(IN PVOID IrpContext, IN PVOID Unused)
Definition: misc.c:221
PGET_DIRTY_STATUS GetDirtyStatus
Definition: vfat.h:343
unsigned short USHORT
Definition: pedump.c:61
FORCEINLINE NTSTATUS VfatDelEntry(PDEVICE_EXTENSION DeviceExt, struct _VFATFCB *Fcb, struct _VFAT_MOVE_CONTEXT *MoveContext)
Definition: vfat.h:388
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:496
unsigned char SysType[4]
Definition: vfat.h:89
ULONG NumberOfClusters
Definition: vfat.h:263
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
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
_In_ PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2464
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:610
PDEVICE_OBJECT DeviceObject
Definition: vfat.h:584
Definition: vfat.h:224
NTSTATUS FAT16FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:171
ULONG PostedRequestCount
Definition: vfat.h:337
NTSTATUS(* PSET_DIRTY_STATUS)(PDEVICE_EXTENSION, BOOLEAN)
Definition: vfat.h:294
ULONG Flags
Definition: vfat.h:413
LIST_ENTRY NotifyList
Definition: vfat.h:351
LIST_ENTRY CloseListHead
Definition: vfat.h:425
ULONG LastAvailableCluster
Definition: vfat.h:325
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
ERESOURCE MainResource
Definition: vfat.h:452
NTSTATUS VfatLockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
Definition: misc.c:461
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:589
struct _STATISTICS STATISTICS
BOOLEAN CloseWorkerRunning
Definition: vfat.h:426
unsigned char ExtBootSignature
Definition: vfat.h:78
NTSTATUS FAT32SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1127
ERESOURCE VolumeListLock
Definition: vfat.h:415
unsigned short CreationTime
Definition: vfat.h:178
Definition: iotypes.h:168
#define BOOLEAN
Definition: pedump.c:73
struct _VFAT_CLOSE_CONTEXT VFAT_CLOSE_CONTEXT
#define OUT
Definition: typedefs.h:40
UNICODE_STRING PathNameU
Definition: vfat.h:472
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:424
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:527
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
ULONG FSInfoSector
Definition: vfat.h:267
unsigned char OEMName[8]
Definition: vfat.h:41
ULONG Flags
Definition: vfat.h:586
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:478
const char * PCSTR
Definition: typedefs.h:52
Definition: File.h:15
unsigned char Media
Definition: vfat.h:66
unsigned short ReservedSectors
Definition: vfat.h:44
USHORT CreationTime
Definition: vfat.h:612
unsigned short AccessDate
Definition: vfat.h:181
HASHENTRY Hash
Definition: vfat.h:514
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:604
PVPB SpareVPB
Definition: vfat.h:359
_In_ PFCB Fcb
Definition: cdprocs.h:159
ULONG OpenHandleCount
Definition: vfat.h:511
NTSTATUS FAT32FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:310
PIO_STACK_LOCATION Stack
Definition: vfat.h:588
unsigned short UpdateTime
Definition: vfat.h:176
unsigned char res0
Definition: vfat.h:40
USHORT Minute
Definition: vfat.h:562
unsigned char Res2[420]
Definition: vfat.h:81
LIST_ENTRY ParentListHead
Definition: vfat.h:493
USHORT Second
Definition: vfat.h:561
ULONG RootCluster
Definition: vfat.h:259
PNOTIFY_SYNC NotifySync
Definition: vfat.h:352
NTSTATUS VfatFileSystemControl(PVFAT_IRP_CONTEXT IrpContext)
Definition: fsctl.c:1395
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:420
USHORT CreationDate
Definition: vfat.h:611
unsigned char Attrib
Definition: vfat.h:172
unsigned short RootEntries
Definition: vfat.h:46
DRIVER_DISPATCH VfatShutdown
Definition: vfat.h:1210
unsigned char Res6[480]
Definition: vfat.h:100
WORK_QUEUE_ITEM WorkQueueItem
Definition: vfat.h:587
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:487
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:1538
unsigned long Unknown
Definition: vfat.h:93
VOID vfatDestroyCCB(PVFATCCB pCcb)
Definition: fcb.c:258
PVFATFCB Fcb
Definition: vfat.h:619