ReactOS 0.4.16-dev-91-g764881a
vfat.h
Go to the documentation of this file.
1#ifndef _VFATFS_PCH_
2#define _VFATFS_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;
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
108typedef 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];
151 unsigned short Unknown2[3];
152 unsigned int EALength;
153 // EA Header
154};
155
157
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
184struct _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
196typedef 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
249typedef struct
250{
252 CHAR VolumeLabel[11];
269
270struct _VFATFCB;
272struct _VFAT_MOVE_CONTEXT;
274
275typedef struct _HASHENTRY
276{
278 struct _VFATFCB* self;
280}
282
284
288
295
296typedef struct _VFAT_DISPATCH
297{
303
304#define STATISTICS_SIZE_NO_PAD (sizeof(FILESYSTEM_STATISTICS) + sizeof(FAT_STATISTICS))
305typedef struct _STATISTICS {
310
311typedef struct DEVICE_EXTENSION
312{
315
320
328 ULONG Flags;
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
368 struct _VFATFCB* Fcb)
369{
370 return DeviceExt->Dispatch.IsDirectoryEmpty(DeviceExt, Fcb);
371}
372
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
389 struct _VFATFCB* Fcb,
390 struct _VFAT_MOVE_CONTEXT* MoveContext)
391{
392 return DeviceExt->Dispatch.DelEntry(DeviceExt, Fcb, MoveContext);
393}
394
398 PVOID *pContext,
399 PVOID *pPage,
400 struct _VFATFCB* pDirFcb,
403{
404 return DeviceExt->Dispatch.GetNextDirEntry(pContext, pPage, pDirFcb, DirContext, First);
405}
406
407#define VFAT_BREAK_ON_CORRUPTION 1
408
409typedef 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
447typedef 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
533
534#define CCB_DELETE_ON_CLOSE 0x0001
535
536typedef struct _VFATCCB
537{
540 /* for DirectoryControl */
542 /* for DirectoryControl */
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
559typedef struct __DOSTIME
560{
564}
566
567typedef struct __DOSDATE
568{
572}
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
581typedef struct
582{
596
598{
606
607typedef struct _VFAT_MOVE_CONTEXT
608{
615
617{
622
626{
627 PULONG Flags = &IrpContext->Flags;
628
629 *Flags &= ~IRPCONTEXT_COMPLETE;
631
632 return STATUS_PENDING;
633}
634
638{
639 return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_DIRECTORY);
640}
641
645{
646 return BooleanFlagOn(*FCB->Attributes, FILE_ATTRIBUTE_READONLY);
647}
648
652{
653 return BooleanFlagOn(DeviceExt->Flags, VCB_IS_FATX);
654}
655
657VOID
659 IN PDEVICE_EXTENSION DeviceExt,
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
685 IN BOOLEAN Override);
686
689 IN PVFAT_IRP_CONTEXT IrpContext,
692 IN ULONG BufferOffset,
693 IN BOOLEAN Wait);
694
701 IN BOOLEAN Override);
702
705 IN PVFAT_IRP_CONTEXT IrpContext,
708 IN ULONG BufferOffset,
709 IN BOOLEAN Wait);
710
714 IN ULONG CtlCode,
716 IN ULONG InputBufferSize,
718 IN OUT PULONG pOutputBufferSize,
719 IN BOOLEAN Override);
720
721/* cleanup.c */
722
725 PVFAT_IRP_CONTEXT IrpContext);
726
727/* close.c */
728
731 PVFAT_IRP_CONTEXT IrpContext);
732
735 PDEVICE_EXTENSION DeviceExt,
737
738/* create.c */
739
742 PVFAT_IRP_CONTEXT IrpContext);
743
746 PDEVICE_EXTENSION DeviceExt,
748 PUNICODE_STRING FileToFindU,
750 BOOLEAN First);
751
752VOID
755 PUNICODE_STRING NameU);
756
757/* dir.c */
758
761 PVFAT_IRP_CONTEXT IrpContext);
762
765 PDEVICE_EXTENSION DeviceExt,
766 USHORT DosDate,
767 USHORT DosTime,
768 PLARGE_INTEGER SystemTime);
769
772 PDEVICE_EXTENSION DeviceExt,
773 PLARGE_INTEGER SystemTime,
774 USHORT *pDosDate,
775 USHORT *pDosTime);
776
777/* direntry.c */
778
779ULONG
781 PDEVICE_EXTENSION pDeviceExt,
782 PDIR_ENTRY pDirEntry);
783
784/* dirwr.c */
785
788 PVCB vcb,
789 PVFATFCB fcb);
790
793 IN PDEVICE_EXTENSION DeviceExt,
794 PVFATFCB pFcb);
795
798 PDEVICE_EXTENSION DeviceExt,
799 PVFATFCB pDirFcb,
800 ULONG nbSlots,
801 PULONG start);
802
805 IN PDEVICE_EXTENSION DeviceExt,
806 IN PVFATFCB pFcb,
808 IN BOOLEAN CaseChangeOnly);
809
812 IN PDEVICE_EXTENSION DeviceExt,
813 IN PVFATFCB pFcb,
816
817/* ea.h */
818
822 PVOID Ea,
824
825/* fastio.c */
826
827CODE_SEG("INIT")
828VOID
831
833NTAPI
836 IN BOOLEAN Wait);
837
838VOID
839NTAPI
842
843/* fat.c */
844
847 PDEVICE_EXTENSION DeviceExt,
848 ULONG CurrentCluster,
850
853 PDEVICE_EXTENSION DeviceExt,
854 PULONG Cluster);
855
858 PDEVICE_EXTENSION DeviceExt,
859 ULONG ClusterToWrite,
860 ULONG NewValue,
861 PULONG OldValue);
862
865 PDEVICE_EXTENSION DeviceExt,
866 ULONG CurrentCluster,
868
871 PDEVICE_EXTENSION DeviceExt,
872 PULONG Cluster);
873
876 PDEVICE_EXTENSION DeviceExt,
877 ULONG ClusterToWrite,
878 ULONG NewValue,
879 PULONG OldValue);
880
883 PDEVICE_EXTENSION DeviceExt,
884 ULONG CurrentCluster,
886
889 PDEVICE_EXTENSION DeviceExt,
890 PULONG Cluster);
891
894 PDEVICE_EXTENSION DeviceExt,
895 ULONG ClusterToWrite,
896 ULONG NewValue,
897 PULONG OldValue);
898
901 PDEVICE_EXTENSION DeviceExt,
902 ULONG FirstCluster,
904 PULONG Cluster,
906
909 PDEVICE_EXTENSION DeviceExt,
910 ULONG Cluster);
911
914 PDEVICE_EXTENSION DeviceExt,
915 ULONG CurrentCluster,
917
920 PDEVICE_EXTENSION DeviceExt,
921 ULONG CurrentCluster,
923
926 PDEVICE_EXTENSION DeviceExt,
927 PLARGE_INTEGER Clusters);
928
931 PDEVICE_EXTENSION DeviceExt,
932 ULONG ClusterToWrite,
933 ULONG NewValue);
934
937 PDEVICE_EXTENSION DeviceExt,
938 PBOOLEAN DirtyStatus);
939
942 PDEVICE_EXTENSION DeviceExt,
943 PBOOLEAN DirtyStatus);
944
947 PDEVICE_EXTENSION DeviceExt,
948 PBOOLEAN DirtyStatus);
949
952 PDEVICE_EXTENSION DeviceExt,
953 BOOLEAN DirtyStatus);
954
957 PDEVICE_EXTENSION DeviceExt,
958 BOOLEAN DirtyStatus);
959
962 PDEVICE_EXTENSION DeviceExt,
963 BOOLEAN DirtyStatus);
964
967 PDEVICE_EXTENSION DeviceExt);
968
969/* fcb.c */
970
974 PUNICODE_STRING pFileNameU);
975
981
988
989VOID
991 PVFATFCB pFCB);
992
993VOID
995 PVFATCCB pCcb);
996
997VOID
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
1013VOID
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
1036 PDEVICE_EXTENSION pDeviceExt,
1037 PUNICODE_STRING pFileNameU);
1038
1041 PDEVICE_EXTENSION pVCB);
1042
1045 PDEVICE_EXTENSION pVCB);
1046
1047BOOLEAN
1049 PVFATFCB FCB);
1050
1051BOOLEAN
1053 PVFATFCB FCB);
1054
1058 PVFATFCB fcb,
1059 PFILE_OBJECT fileObject);
1060
1063 PDEVICE_EXTENSION pVCB,
1064 PVFATFCB parentFCB,
1065 PUNICODE_STRING FileToFindU,
1066 PVFATFCB *fileFCB);
1067
1070 PDEVICE_EXTENSION pVCB,
1071 PVFATFCB *pParentFCB,
1072 PVFATFCB *pFCB,
1073 PUNICODE_STRING pFileNameU);
1074
1077 PVCB vcb,
1078 PVFATFCB directoryFCB,
1080 PVFATFCB *fileFCB);
1081
1082/* finfo.c */
1083
1086 PVFATFCB FCB,
1087 PFILE_STANDARD_INFORMATION StandardInfo,
1089
1093 PVFATFCB FCB,
1094 PDEVICE_EXTENSION DeviceExt,
1095 PFILE_BASIC_INFORMATION BasicInfo,
1097
1100 PVFAT_IRP_CONTEXT IrpContext);
1101
1104 PVFAT_IRP_CONTEXT IrpContext);
1105
1109 PVFATFCB Fcb,
1110 PDEVICE_EXTENSION DeviceExt,
1112
1113/* flush.c */
1114
1116VfatFlush(
1117 PVFAT_IRP_CONTEXT IrpContext);
1118
1121 PDEVICE_EXTENSION DeviceExt,
1122 PVFATFCB VolumeFcb);
1123
1124/* fsctl.c */
1125
1128 PVFAT_IRP_CONTEXT IrpContext);
1129
1130/* iface.c */
1131
1132CODE_SEG("INIT")
1134NTAPI
1138
1139#ifdef KDBG
1140/* kdbg.c */
1141KDBG_CLI_ROUTINE vfatKdbgHandler;
1142#endif
1143
1144/* misc.c */
1145
1148
1150NTAPI
1153 PIRP Irp);
1154
1155PVOID
1157 IN PIRP Irp,
1158 IN BOOLEAN Paging);
1159
1162 IN PIRP Irp,
1163 IN ULONG Length,
1165
1166BOOLEAN
1168 IN PDEVICE_EXTENSION DeviceExt,
1169 IN BOOLEAN Create);
1170
1171VOID
1173 IN PDEVICE_EXTENSION DeviceExt,
1174 IN PVFATFCB Fcb,
1176 IN ULONG Action);
1177
1178VOID
1179NTAPI
1181 IN PVOID IrpContext,
1182 IN PVOID Unused);
1183
1184/* pnp.c */
1185
1187VfatPnp(
1188 PVFAT_IRP_CONTEXT IrpContext);
1189
1190/* rw.c */
1191
1193VfatRead(
1194 PVFAT_IRP_CONTEXT IrpContext);
1195
1197VfatWrite(
1198 PVFAT_IRP_CONTEXT *pIrpContext);
1199
1202 PDEVICE_EXTENSION DeviceExt,
1203 ULONG FirstCluster,
1204 PULONG CurrentCluster,
1205 BOOLEAN Extend);
1206
1207/* shutdown.c */
1208
1211
1213NTAPI
1216 PIRP Irp);
1217
1218/* string.c */
1219
1220VOID
1222 PUNICODE_STRING PathNameU,
1223 PUNICODE_STRING DirNameU,
1224 PUNICODE_STRING FileNameU);
1225
1226BOOLEAN
1228 WCHAR c);
1229
1230BOOLEAN
1233
1234/* volume.c */
1235
1238 PVFAT_IRP_CONTEXT IrpContext);
1239
1242 PVFAT_IRP_CONTEXT IrpContext);
1243
1244#endif /* _VFATFS_PCH_ */
#define CODE_SEG(...)
ULONG ReadLength
ULONG WriteLength
Definition: CcPinRead_drv.c:40
WCHAR First[]
Definition: FormatMessage.c:11
unsigned char BOOLEAN
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx 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:732
LONG NTSTATUS
Definition: precomp.h:26
@ Create
Definition: registry.c:563
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
_In_ PFCB ParentFcb
Definition: cdprocs.h:736
_In_ PFCB Fcb
Definition: cdprocs.h:159
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT DirContext
Definition: cdprocs.h:425
Definition: bufpool.h:45
Definition: File.h:16
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define NTSTATUS
Definition: precomp.h:21
VOID NTAPI Extend(VOID)
Definition: extend.c:14
@ FindFile
Definition: find.c:28
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
ULONG ERESOURCE
Definition: env_spec_w32.h:594
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
IN PVCB IN PDIRENT OUT PULONG EaLength
Definition: fatprocs.h:879
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:323
FP_OP Operation
Definition: fpcontrol.c:150
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG FilterMatch
Definition: fsrtlfuncs.h:743
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
GLuint start
Definition: gl.h:1545
const GLubyte * c
Definition: glext.h:8905
#define Unused(x)
Definition: atlwin.h:28
_In_ PNDIS_STRING _In_ PNDIS_STRING _Out_ PDEVICE_OBJECT * pDeviceObject
Definition: ndis.h:4679
DRIVER_DISPATCH(nfs41_FsdDispatch)
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
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:1552
#define STATUS_PENDING
Definition: ntstatus.h:82
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define BOOLEAN
Definition: pedump.c:73
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
void(* Func)(int)
LIST_ENTRY VolumeListEntry
Definition: vfat.h:348
ULONG OverflowQueueCount
Definition: vfat.h:336
KSPIN_LOCK FcbListLock
Definition: ntfs.h:106
PNOTIFY_SYNC NotifySync
Definition: vfat.h:352
PWRITE_CLUSTER WriteCluster
Definition: vfat.h:342
PGET_NEXT_CLUSTER GetNextCluster
Definition: vfat.h:340
LIST_ENTRY NotifyList
Definition: vfat.h:351
ERESOURCE FatResource
Definition: vfat.h:314
VFAT_DISPATCH Dispatch
Definition: vfat.h:362
PFIND_AND_MARK_AVAILABLE_CLUSTER FindAndMarkAvailableCluster
Definition: vfat.h:341
struct _VFATFCB * RootFcb
Definition: vfat.h:330
ULONG OpenHandleCount
Definition: ntfs.h:123
BOOLEAN AvailableClustersValid
Definition: vfat.h:327
ULONG HashTableSize
Definition: vfat.h:318
PSTATISTICS Statistics
Definition: vfat.h:331
PSET_DIRTY_STATUS SetDirtyStatus
Definition: vfat.h:344
ULONG PostedRequestCount
Definition: vfat.h:337
PDEVICE_OBJECT StorageDevice
Definition: ntfs.h:110
ULONG LastAvailableCluster
Definition: vfat.h:325
LIST_ENTRY OverflowQueue
Definition: vfat.h:335
ULONG AvailableClusters
Definition: vfat.h:326
struct _HASHENTRY ** FcbHashTable
Definition: vfat.h:319
LIST_ENTRY FcbListHead
Definition: ntfs.h:107
PDEVICE_OBJECT VolumeDevice
Definition: vfat.h:321
ULONG Flags
Definition: ntfs.h:122
PGET_DIRTY_STATUS GetDirtyStatus
Definition: vfat.h:343
PFILE_OBJECT FATFileObject
Definition: vfat.h:323
PVPB IoVPB
Definition: vfat.h:358
ULONG BaseDateYear
Definition: vfat.h:346
ERESOURCE DirResource
Definition: ntfs.h:103
FATINFO FatInfo
Definition: vfat.h:324
PVPB SpareVPB
Definition: vfat.h:359
struct _VFATFCB * VolumeFcb
Definition: vfat.h:329
KSPIN_LOCK OverflowQueueSpinLock
Definition: vfat.h:334
Definition: vfat.h:250
ULONG FSInfoSector
Definition: vfat.h:267
ULONG dataStart
Definition: vfat.h:258
ULONG Sectors
Definition: vfat.h:265
ULONG rootDirectorySectors
Definition: vfat.h:256
BOOLEAN FixedMedia
Definition: vfat.h:266
ULONG FATCount
Definition: vfat.h:254
ULONG BytesPerSector
Definition: vfat.h:261
ULONG rootStart
Definition: vfat.h:257
ULONG BytesPerCluster
Definition: vfat.h:262
ULONG RootCluster
Definition: vfat.h:259
ULONG SectorsPerCluster
Definition: vfat.h:260
ULONG VolumeID
Definition: vfat.h:251
ULONG NumberOfClusters
Definition: vfat.h:263
ULONG FatType
Definition: vfat.h:264
ULONG FATStart
Definition: vfat.h:253
ULONG FATSectors
Definition: vfat.h:255
Definition: ncftp.h:79
ULONG Flags
Definition: vfat.h:413
NPAGED_LOOKASIDE_LIST IrpContextLookasideList
Definition: vfat.h:419
NPAGED_LOOKASIDE_LIST CcbLookasideList
Definition: vfat.h:418
PDRIVER_OBJECT DriverObject
Definition: vfat.h:411
BOOLEAN CloseWorkerRunning
Definition: vfat.h:426
ERESOURCE VolumeListLock
Definition: vfat.h:415
ULONG NumberProcessors
Definition: vfat.h:414
NPAGED_LOOKASIDE_LIST FcbLookasideList
Definition: vfat.h:417
FAST_IO_DISPATCH FastIoDispatch
Definition: vfat.h:421
PIO_WORKITEM CloseWorkItem
Definition: vfat.h:427
PAGED_LOOKASIDE_LIST CloseContextLookasideList
Definition: vfat.h:420
CACHE_MANAGER_CALLBACKS CacheMgrCallbacks
Definition: vfat.h:422
FAST_MUTEX CloseMutex
Definition: vfat.h:423
LIST_ENTRY CloseListHead
Definition: vfat.h:425
ULONG CloseCount
Definition: vfat.h:424
LIST_ENTRY VolumeListHead
Definition: vfat.h:416
PDEVICE_OBJECT DeviceObject
Definition: vfat.h:412
BOOLEAN ShutdownStarted
Definition: vfat.h:428
UCHAR MinorFunction
Definition: vfat.h:590
CCHAR PriorityBoost
Definition: vfat.h:594
PDEVICE_OBJECT DeviceObject
Definition: vfat.h:584
UCHAR MajorFunction
Definition: vfat.h:589
KEVENT Event
Definition: vfat.h:593
ULONG Flags
Definition: vfat.h:586
WORK_QUEUE_ITEM WorkQueueItem
Definition: vfat.h:587
PDEVICE_EXTENSION DeviceExt
Definition: vfat.h:585
PIO_STACK_LOCATION Stack
Definition: vfat.h:588
ULONG RefCount
Definition: vfat.h:592
PFILE_OBJECT FileObject
Definition: vfat.h:591
unsigned char SysType[8]
Definition: vfat.h:80
unsigned short Heads
Definition: vfat.h:67
unsigned char ExtBootSignature
Definition: vfat.h:78
unsigned char SectorsPerCluster
Definition: vfat.h:62
unsigned char Drive
Definition: vfat.h:76
unsigned char FATCount
Definition: vfat.h:64
unsigned short BootBackup
Definition: vfat.h:74
unsigned long FATSectors32
Definition: vfat.h:69
unsigned short Sectors
Definition: vfat.h:65
unsigned char magic0
Definition: vfat.h:59
unsigned short Signature1
Definition: vfat.h:82
unsigned short SectorsPerTrack
Definition: vfat.h:67
unsigned short ReservedSectors
Definition: vfat.h:63
unsigned char VolumeLabel[11]
Definition: vfat.h:80
unsigned long HiddenSectors
Definition: vfat.h:68
unsigned short FATSectors
Definition: vfat.h:67
unsigned long RootCluster
Definition: vfat.h:72
unsigned short ExtFlag
Definition: vfat.h:70
unsigned char OEMName[8]
Definition: vfat.h:60
unsigned short FSInfoSector
Definition: vfat.h:73
unsigned char Media
Definition: vfat.h:66
unsigned char magic1
Definition: vfat.h:59
unsigned char Res3[12]
Definition: vfat.h:75
unsigned short BytesPerSector
Definition: vfat.h:61
unsigned long SectorsHuge
Definition: vfat.h:68
unsigned char Res4
Definition: vfat.h:77
unsigned char res0
Definition: vfat.h:59
unsigned long VolumeID
Definition: vfat.h:79
unsigned char Res2[420]
Definition: vfat.h:81
unsigned short FSVersion
Definition: vfat.h:71
unsigned short RootEntries
Definition: vfat.h:65
unsigned char Unused[4078]
Definition: vfat.h:94
unsigned long Unknown
Definition: vfat.h:93
unsigned char SysType[4]
Definition: vfat.h:89
unsigned long SectorsPerCluster
Definition: vfat.h:91
unsigned short FATCount
Definition: vfat.h:92
unsigned long VolumeID
Definition: vfat.h:90
unsigned char OEMName[8]
Definition: vfat.h:41
unsigned short FATSectors
Definition: vfat.h:48
unsigned long SectorsHuge
Definition: vfat.h:49
unsigned short ReservedSectors
Definition: vfat.h:44
unsigned char VolumeLabel[11]
Definition: vfat.h:52
unsigned short SectorsPerTrack
Definition: vfat.h:48
unsigned char Sig
Definition: vfat.h:50
unsigned short Signatur1
Definition: vfat.h:54
unsigned char Media
Definition: vfat.h:47
unsigned char res0
Definition: vfat.h:40
unsigned short BytesPerSector
Definition: vfat.h:42
unsigned char Drive
Definition: vfat.h:50
unsigned char FATCount
Definition: vfat.h:45
unsigned char magic1
Definition: vfat.h:40
unsigned char Res2[448]
Definition: vfat.h:53
unsigned char SectorsPerCluster
Definition: vfat.h:43
unsigned long HiddenSectors
Definition: vfat.h:49
unsigned short RootEntries
Definition: vfat.h:46
unsigned char Res1
Definition: vfat.h:50
unsigned short Sectors
Definition: vfat.h:46
unsigned short Heads
Definition: vfat.h:48
unsigned char magic0
Definition: vfat.h:40
unsigned char SysType[8]
Definition: vfat.h:52
unsigned long VolumeID
Definition: vfat.h:51
unsigned short EASetTable[240]
Definition: vfat.h:140
unsigned short Signature
Definition: vfat.h:138
unsigned short Unknown[15]
Definition: vfat.h:139
unsigned char Unknown
Definition: vfat.h:160
unsigned char EANameLength
Definition: vfat.h:161
unsigned short EAValueLength
Definition: vfat.h:162
unsigned short Unknown1[2]
Definition: vfat.h:149
unsigned int EALength
Definition: vfat.h:152
unsigned short Signature
Definition: vfat.h:147
char TargetFileName[12]
Definition: vfat.h:150
unsigned short Offset
Definition: vfat.h:148
unsigned short Unknown2[3]
Definition: vfat.h:151
unsigned char CreationTimeMs
Definition: vfat.h:119
unsigned short UpdateDate
Definition: vfat.h:127
unsigned char Filename[8]
Definition: vfat.h:114
unsigned char ShortName[11]
Definition: vfat.h:115
unsigned short CreationDate
Definition: vfat.h:120
unsigned long FileSize
Definition: vfat.h:129
unsigned short FirstCluster
Definition: vfat.h:128
unsigned short CreationTime
Definition: vfat.h:120
unsigned short FirstClusterHigh
Definition: vfat.h:123
unsigned char Ext[3]
Definition: vfat.h:114
unsigned char lCase
Definition: vfat.h:118
unsigned short ExtendedAttributes
Definition: vfat.h:124
unsigned short UpdateTime
Definition: vfat.h:126
unsigned char Attrib
Definition: vfat.h:117
unsigned short AccessDate
Definition: vfat.h:120
unsigned short AccessTime
Definition: vfat.h:180
unsigned char Attrib
Definition: vfat.h:172
unsigned short AccessDate
Definition: vfat.h:181
unsigned short UpdateDate
Definition: vfat.h:177
unsigned long FileSize
Definition: vfat.h:175
unsigned short CreationDate
Definition: vfat.h:179
unsigned long FirstCluster
Definition: vfat.h:174
unsigned short UpdateTime
Definition: vfat.h:176
unsigned char Filename[42]
Definition: vfat.h:173
unsigned char FilenameLength
Definition: vfat.h:171
unsigned short CreationTime
Definition: vfat.h:178
Definition: cdstruc.h:902
unsigned long Signatur2
Definition: vfat.h:105
unsigned long FSINFOSignature
Definition: vfat.h:101
unsigned long FreeCluster
Definition: vfat.h:102
unsigned char Res6[480]
Definition: vfat.h:100
unsigned long ExtBootSignature2
Definition: vfat.h:99
unsigned long NextCluster
Definition: vfat.h:103
unsigned char Res7[12]
Definition: vfat.h:104
struct _HASHENTRY * next
Definition: vfat.h:279
struct _VFATFCB * self
Definition: vfat.h:278
ULONG Hash
Definition: vfat.h:277
Definition: typedefs.h:120
UCHAR Pad[((STATISTICS_SIZE_NO_PAD+0x3f) &~0x3f) - STATISTICS_SIZE_NO_PAD]
Definition: vfat.h:308
FAT_STATISTICS Fat
Definition: vfat.h:307
FILESYSTEM_STATISTICS Base
Definition: vfat.h:306
Definition: cdstruc.h:498
Definition: vfat.h:537
ULONG Flags
Definition: vfat.h:539
ULONG Entry
Definition: vfat.h:541
UNICODE_STRING SearchPattern
Definition: vfat.h:543
LARGE_INTEGER CurrentByteOffset
Definition: vfat.h:538
Definition: vfat.h:448
FILE_LOCK FileLock
Definition: vfat.h:520
PFILE_OBJECT FileObject
Definition: vfat.h:499
ULONG Flags
Definition: vfat.h:496
LIST_ENTRY ParentListEntry
Definition: vfat.h:487
FAST_MUTEX LastMutex
Definition: vfat.h:527
ULONG dirIndex
Definition: vfat.h:502
ERESOURCE PagingIoResource
Definition: vfat.h:453
UNICODE_STRING ShortNameU
Definition: vfat.h:466
ULONG startIndex
Definition: vfat.h:505
WCHAR ShortNameBuffer[13]
Definition: vfat.h:478
FSRTL_COMMON_FCB_HEADER RFCB
Definition: vfat.h:450
UNICODE_STRING PathNameU
Definition: vfat.h:472
ULONG LastOffset
Definition: vfat.h:529
PUCHAR Attributes
Definition: vfat.h:460
PWCHAR PathNameBuffer
Definition: vfat.h:475
HASHENTRY Hash
Definition: vfat.h:514
struct _VFATFCB * parentFcb
Definition: vfat.h:490
HASHENTRY ShortHash
Definition: vfat.h:517
LIST_ENTRY ParentListHead
Definition: vfat.h:493
LIST_ENTRY FcbListEntry
Definition: vfat.h:484
DIR_ENTRY entry
Definition: vfat.h:457
ERESOURCE MainResource
Definition: vfat.h:452
SHARE_ACCESS FCBShareAccess
Definition: vfat.h:508
ULONG OpenHandleCount
Definition: vfat.h:511
LONG RefCount
Definition: vfat.h:481
UNICODE_STRING DirNameU
Definition: vfat.h:469
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: vfat.h:451
struct _VFAT_CLOSE_CONTEXT * CloseContext
Definition: vfat.h:531
UNICODE_STRING LongNameU
Definition: vfat.h:463
ULONG LastCluster
Definition: vfat.h:528
PVFATFCB Fcb
Definition: vfat.h:619
LIST_ENTRY CloseListEntry
Definition: vfat.h:620
PDEVICE_EXTENSION Vcb
Definition: vfat.h:618
UNICODE_STRING ShortNameU
Definition: vfat.h:603
UNICODE_STRING LongNameU
Definition: vfat.h:602
DIR_ENTRY DirEntry
Definition: vfat.h:601
PDEVICE_EXTENSION DeviceExt
Definition: vfat.h:604
PDEL_ENTRY DelEntry
Definition: vfat.h:300
PGET_NEXT_DIR_ENTRY GetNextDirEntry
Definition: vfat.h:301
PADD_ENTRY AddEntry
Definition: vfat.h:299
PIS_DIRECTORY_EMPTY IsDirectoryEmpty
Definition: vfat.h:298
USHORT CreationDate
Definition: vfat.h:611
ULONG FirstCluster
Definition: vfat.h:609
ULONG FileSize
Definition: vfat.h:610
USHORT CreationTime
Definition: vfat.h:612
BOOLEAN InPlace
Definition: vfat.h:613
Definition: iotypes.h:189
USHORT Year
Definition: vfat.h:571
USHORT Day
Definition: vfat.h:569
USHORT Month
Definition: vfat.h:570
USHORT Second
Definition: vfat.h:561
USHORT Hour
Definition: vfat.h:563
USHORT Minute
Definition: vfat.h:562
Definition: vfat.h:185
WCHAR name11_12[2]
Definition: vfat.h:193
WCHAR name5_10[6]
Definition: vfat.h:191
unsigned char id
Definition: vfat.h:186
unsigned char alias_checksum
Definition: vfat.h:190
unsigned char attr
Definition: vfat.h:188
WCHAR name0_4[5]
Definition: vfat.h:187
unsigned char reserved
Definition: vfat.h:189
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
const char * PCSTR
Definition: typedefs.h:52
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
char CCHAR
Definition: typedefs.h:51
Definition: vfat.h:225
FAT_DIR_ENTRY Fat
Definition: vfat.h:226
FATX_DIR_ENTRY FatX
Definition: vfat.h:227
NTSTATUS(* PADD_ENTRY)(PDEVICE_EXTENSION, PUNICODE_STRING, struct _VFATFCB **, struct _VFATFCB *, ULONG, UCHAR, struct _VFAT_MOVE_CONTEXT *)
Definition: vfat.h:290
PVFAT_GLOBAL_DATA VfatGlobalData
Definition: iface.c:18
struct _VFAT_MOVE_CONTEXT VFAT_MOVE_CONTEXT
struct _VFAT_DISPATCH * PVFAT_DISPATCH
NTSTATUS(* PGET_NEXT_DIR_ENTRY)(PVOID *, PVOID *, struct _VFATFCB *, struct _VFAT_DIRENTRY_CONTEXT *, BOOLEAN)
Definition: vfat.h:292
struct _EAHeader * PFAT_EA_HEADER
Definition: vfat.h:156
struct _VFAT_DIRENTRY_CONTEXT * PVFAT_DIRENTRY_CONTEXT
struct DEVICE_EXTENSION DEVICE_EXTENSION
NTSTATUS VfatSetInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: finfo.c:1561
NTSTATUS FAT32GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:28
struct _VFATFCB * PVFATFCB
NTSTATUS VfatGetBasicInformation(PFILE_OBJECT FileObject, PVFATFCB FCB, PDEVICE_EXTENSION DeviceExt, PFILE_BASIC_INFORMATION BasicInfo, PULONG BufferLength)
Definition: finfo.c:280
#define IRPCONTEXT_QUEUE
Definition: vfat.h:577
NTSTATUS vfatDirFindFile(PDEVICE_EXTENSION pVCB, PVFATFCB parentFCB, PUNICODE_STRING FileToFindU, PVFATFCB *fileFCB)
Definition: fcb.c:790
BOOLEAN vfatIsLongIllegal(WCHAR c)
Definition: string.c:21
NTSTATUS GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:744
NTSTATUS FAT12FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:244
NTSTATUS VfatSetVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: volume.c:510
struct _VFAT_CLOSE_CONTEXT * PVFAT_CLOSE_CONTEXT
NTSTATUS vfatUpdateFCB(PDEVICE_EXTENSION pVCB, PVFATFCB Fcb, PVFAT_DIRENTRY_CONTEXT DirContext, PVFATFCB ParentFcb)
Definition: fcb.c:539
VOID vfatSplitPathName(PUNICODE_STRING PathNameU, PUNICODE_STRING DirNameU, PUNICODE_STRING FileNameU)
Definition: fcb.c:54
NTSTATUS VfatRead(PVFAT_IRP_CONTEXT IrpContext)
Definition: rw.c:708
NTSTATUS VfatWrite(PVFAT_IRP_CONTEXT *pIrpContext)
Definition: rw.c:873
NTSTATUS NextCluster(PDEVICE_EXTENSION DeviceExt, ULONG FirstCluster, PULONG CurrentCluster, BOOLEAN Extend)
Definition: rw.c:38
PVFATFCB vfatOpenRootFCB(PDEVICE_EXTENSION pVCB)
Definition: fcb.c:708
struct _FATDirEntry * PFAT_DIR_ENTRY
Definition: vfat.h:167
NTSTATUS VfatCloseFile(PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject)
Definition: close.c:159
NTSTATUS CountAvailableClusters(PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER Clusters)
Definition: fat.c:541
NTSTATUS vfatRenameEntry(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB pFcb, IN PUNICODE_STRING FileName, IN BOOLEAN CaseChangeOnly)
Definition: dirwr.c:178
NTSTATUS VfatWriteDisk(IN PDEVICE_OBJECT pDeviceObject, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN OUT PUCHAR Buffer, IN BOOLEAN Override)
Definition: blockdev.c:253
struct _VFATFCB VFATFCB
NTSTATUS VfatQueryVolumeInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: volume.c:431
FORCEINLINE BOOLEAN vfatFCBIsReadOnly(PVFATFCB FCB)
Definition: vfat.h:644
NTSTATUS FAT16SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1044
struct _VFATCCB VFATCCB
BOOLEAN vfatFCBIsRoot(PVFATFCB FCB)
Definition: fcb.c:293
PVFATFCB vfatMakeRootFCB(PDEVICE_EXTENSION pVCB)
Definition: fcb.c:648
NTSTATUS FAT16GetDirtyStatus(PDEVICE_EXTENSION DeviceExt, PBOOLEAN DirtyStatus)
Definition: fat.c:858
struct _FATXDirEntry * PFATX_DIR_ENTRY
Definition: vfat.h:222
NTSTATUS VfatReadDisk(IN PDEVICE_OBJECT pDeviceObject, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, IN PUCHAR Buffer, IN BOOLEAN Override)
NTSTATUS SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1017
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
BOOLEAN VfatCheckForDismount(IN PDEVICE_EXTENSION DeviceExt, IN BOOLEAN Create)
Definition: misc.c:495
struct _HASHENTRY HASHENTRY
NTSTATUS FAT32GetDirtyStatus(PDEVICE_EXTENSION DeviceExt, PBOOLEAN DirtyStatus)
Definition: fat.c:936
struct DEVICE_EXTENSION * PVCB
BOOLEAN vfatFindDirSpace(PDEVICE_EXTENSION DeviceExt, PVFATFCB pDirFcb, ULONG nbSlots, PULONG start)
PVFATFCB vfatGrabFCBFromTable(PDEVICE_EXTENSION pDeviceExt, PUNICODE_STRING pFileNameU)
Definition: fcb.c:594
union _DIR_ENTRY * PDIR_ENTRY
Definition: vfat.h:230
VOID vfatDestroyFCB(PVFATFCB pFCB)
Definition: fcb.c:268
NTSTATUS vfatAttachFCBToFileObject(PDEVICE_EXTENSION vcb, PVFATFCB fcb, PFILE_OBJECT fileObject)
Definition: fcb.c:754
VOID vfatDestroyCCB(PVFATCCB pCcb)
Definition: fcb.c:257
NTSTATUS VfatCleanup(PVFAT_IRP_CONTEXT IrpContext)
Definition: cleanup.c:176
#define VCB_IS_FATX
Definition: vfat.h:242
struct _STATISTICS STATISTICS
NTSTATUS FAT32WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue, PULONG OldValue)
Definition: fat.c:661
NTSTATUS VfatWriteDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN ULONG BufferOffset, IN BOOLEAN Wait)
Definition: blockdev.c:334
NTSTATUS(* PSET_DIRTY_STATUS)(PDEVICE_EXTENSION, BOOLEAN)
Definition: vfat.h:294
FORCEINLINE BOOLEAN vfatFCBIsDirectory(PVFATFCB FCB)
Definition: vfat.h:637
VOID VfatInitFastIoRoutines(PFAST_IO_DISPATCH FastIoDispatch)
Definition: fastio.c:753
BOOLEAN FsdDosDateTimeToSystemTime(PDEVICE_EXTENSION DeviceExt, USHORT DosDate, USHORT DosTime, PLARGE_INTEGER SystemTime)
Definition: dir.c:21
struct __DOSDATE DOSDATE
struct __DOSTIME * PDOSTIME
struct DEVICE_EXTENSION VCB
BOOLEAN IsDotOrDotDot(PCUNICODE_STRING Name)
Definition: string.c:28
NTSTATUS vfatMakeFCBFromDirEntry(PVCB vcb, PVFATFCB directoryFCB, PVFAT_DIRENTRY_CONTEXT DirContext, PVFATFCB *fileFCB)
Definition: fcb.c:725
DRIVER_DISPATCH VfatBuildRequest
Definition: vfat.h:1147
NTSTATUS FAT32UpdateFreeClustersCount(PDEVICE_EXTENSION DeviceExt)
Definition: fat.c:1215
NTSTATUS VfatLockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
Definition: misc.c:460
NTSTATUS VfatMoveEntry(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB pFcb, IN PUNICODE_STRING FileName, IN PVFATFCB ParentFcb)
Definition: dirwr.c:1122
NTSTATUS(* PGET_DIRTY_STATUS)(PDEVICE_EXTENSION, PBOOLEAN)
Definition: vfat.h:293
NTSTATUS vfatSetFCBNewDirName(PDEVICE_EXTENSION pVCB, PVFATFCB Fcb, PVFATFCB ParentFcb)
Definition: fcb.c:492
NTSTATUS VfatFileSystemControl(PVFAT_IRP_CONTEXT IrpContext)
Definition: fsctl.c:1378
FORCEINLINE BOOLEAN VfatIsDirectoryEmpty(PDEVICE_EXTENSION DeviceExt, struct _VFATFCB *Fcb)
Definition: vfat.h:367
NTSTATUS VfatDirectoryControl(PVFAT_IRP_CONTEXT IrpContext)
Definition: dir.c:727
BOOLEAN NTAPI VfatAcquireForLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: fastio.c:723
NTSTATUS VfatFlush(PVFAT_IRP_CONTEXT IrpContext)
Definition: flush.c:149
FORCEINLINE NTSTATUS VfatGetNextDirEntry(PDEVICE_EXTENSION DeviceExt, PVOID *pContext, PVOID *pPage, struct _VFATFCB *pDirFcb, struct _VFAT_DIRENTRY_CONTEXT *DirContext, BOOLEAN First)
Definition: vfat.h:397
DRIVER_DISPATCH VfatShutdown
Definition: vfat.h:1210
NTSTATUS VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject, PVFATFCB Fcb, PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER AllocationSize)
Definition: finfo.c:1211
NTSTATUS VfatPnp(PVFAT_IRP_CONTEXT IrpContext)
Definition: pnp.c:18
NTSTATUS FAT12WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue, PULONG OldValue)
Definition: fat.c:570
NTSTATUS WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue)
Definition: fat.c:705
NTSTATUS FAT16FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:173
NTSTATUS GetNextClusterExtend(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:773
NTSTATUS OffsetToCluster(PDEVICE_EXTENSION DeviceExt, ULONG FirstCluster, ULONG FileOffset, PULONG Cluster, BOOLEAN Extend)
Definition: rw.c:59
NTSTATUS vfatGetFCBForFile(PDEVICE_EXTENSION pVCB, PVFATFCB *pParentFCB, PVFATFCB *pFCB, PUNICODE_STRING pFileNameU)
Definition: fcb.c:883
NTSTATUS FAT12GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:123
struct VFAT_GLOBAL_DATA * PVFAT_GLOBAL_DATA
NTSTATUS(* PFIND_AND_MARK_AVAILABLE_CLUSTER)(PDEVICE_EXTENSION, PULONG)
Definition: vfat.h:286
struct _VFAT_MOVE_CONTEXT * PVFAT_MOVE_CONTEXT
NTSTATUS VfatUpdateEntry(IN PDEVICE_EXTENSION DeviceExt, PVFATFCB pFcb)
ULONGLONG ClusterToSector(PDEVICE_EXTENSION DeviceExt, ULONG Cluster)
Definition: fat.c:731
NTSTATUS VfatQueryInformation(PVFAT_IRP_CONTEXT IrpContext)
Definition: finfo.c:1434
NTSTATUS VfatSetExtendedAttributes(PFILE_OBJECT FileObject, PVOID Ea, ULONG EaLength)
Definition: ea.c:18
VOID NTAPI VfatHandleDeferredWrite(IN PVOID IrpContext, IN PVOID Unused)
Definition: misc.c:220
NTSTATUS FAT32SetDirtyStatus(PDEVICE_EXTENSION DeviceExt, BOOLEAN DirtyStatus)
Definition: fat.c:1129
PVFATFCB vfatNewFCB(PDEVICE_EXTENSION pVCB, PUNICODE_STRING pFileNameU)
Definition: fcb.c:128
struct VFAT_IRP_CONTEXT * PVFAT_IRP_CONTEXT
NTSTATUS FAT16GetNextCluster(PDEVICE_EXTENSION DeviceExt, ULONG CurrentCluster, PULONG NextCluster)
Definition: fat.c:77
struct _VFATCCB * PVFATCCB
VOID vfat8Dot3ToString(PFAT_DIR_ENTRY pEntry, PUNICODE_STRING NameU)
Definition: create.c:19
NTSTATUS VfatClose(PVFAT_IRP_CONTEXT IrpContext)
Definition: close.c:212
FORCEINLINE NTSTATUS VfatDelEntry(PDEVICE_EXTENSION DeviceExt, struct _VFATFCB *Fcb, struct _VFAT_MOVE_CONTEXT *MoveContext)
Definition: vfat.h:388
NTSTATUS FAT16WriteCluster(PDEVICE_EXTENSION DeviceExt, ULONG ClusterToWrite, ULONG NewValue, PULONG OldValue)
Definition: fat.c:621
struct _EAFileHeader * PFAT_EA_FILE_HEADER
Definition: vfat.h:134
NTSTATUS VfatFlushVolume(PDEVICE_EXTENSION DeviceExt, PVFATFCB VolumeFcb)
Definition: flush.c:51
struct __DOSDATE * PDOSDATE
struct __DOSTIME DOSTIME
VOID vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
Definition: fcb.c:335
BOOLEAN(* PIS_DIRECTORY_EMPTY)(PDEVICE_EXTENSION, struct _VFATFCB *)
Definition: vfat.h:289
NTSTATUS GetDirtyStatus(PDEVICE_EXTENSION DeviceExt, PBOOLEAN DirtyStatus)
Definition: fat.c:831
NTSTATUS vfatFCBInitializeCacheFromVolume(PVCB vcb, PVFATFCB fcb)
Definition: dirwr.c:22
PVOID VfatGetUserBuffer(IN PIRP Irp, IN BOOLEAN Paging)
Definition: misc.c:443
VOID NTAPI VfatReleaseFromLazyWrite(IN PVOID Context)
Definition: fastio.c:741
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:430
struct _VFAT_DIRENTRY_CONTEXT VFAT_DIRENTRY_CONTEXT
NTSTATUS FAT32FindAndMarkAvailableCluster(PDEVICE_EXTENSION DeviceExt, PULONG Cluster)
Definition: fat.c:312
ULONG vfatDirEntryGetFirstCluster(PDEVICE_EXTENSION pDeviceExt, PDIR_ENTRY pDirEntry)
Definition: direntry.c:18
NTSTATUS VfatGetStandardInformation(PVFATFCB FCB, PFILE_STANDARD_INFORMATION StandardInfo, PULONG BufferLength)
Definition: finfo.c:73
NTSTATUS(* PDEL_ENTRY)(PDEVICE_EXTENSION, struct _VFATFCB *, struct _VFAT_MOVE_CONTEXT *)
Definition: vfat.h:291
NTSTATUS VfatReadDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, IN ULONG BufferOffset, IN BOOLEAN Wait)
FORCEINLINE BOOLEAN vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt)
Definition: vfat.h:651
struct _EASetHeader * PFAT_EA_SET_HEADER
Definition: vfat.h:143
struct _STATISTICS * PSTATISTICS
#define STATISTICS_SIZE_NO_PAD
Definition: vfat.h:304
struct _VFAT_CLOSE_CONTEXT VFAT_CLOSE_CONTEXT
FORCEINLINE NTSTATUS VfatMarkIrpContextForQueue(PVFAT_IRP_CONTEXT IrpContext)
Definition: vfat.h:625
struct FATINFO * PFATINFO
BOOLEAN FsdSystemTimeToDosDateTime(PDEVICE_EXTENSION DeviceExt, PLARGE_INTEGER SystemTime, USHORT *pDosDate, USHORT *pDosTime)
FORCEINLINE VOID vfatReportChange(IN PDEVICE_EXTENSION DeviceExt, IN PVFATFCB Fcb, IN ULONG FilterMatch, IN ULONG Action)
Definition: vfat.h:658
VOID vfatGrabFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB)
Definition: fcb.c:301
struct _VFAT_DISPATCH VFAT_DISPATCH
NTSTATUS VfatCreate(PVFAT_IRP_CONTEXT IrpContext)
Definition: create.c:1070
NTSTATUS(* PGET_NEXT_CLUSTER)(PDEVICE_EXTENSION, ULONG, PULONG)
Definition: vfat.h:285
NTSTATUS(* PWRITE_CLUSTER)(PDEVICE_EXTENSION, ULONG, ULONG, PULONG)
Definition: vfat.h:287
struct DEVICE_EXTENSION * PDEVICE_EXTENSION
Definition: vfat.h:283
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
#define FORCEINLINE
Definition: wdftypes.h:67
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET ReadOffset
Definition: wdfusb.h:2003
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET WriteOffset
Definition: wdfusb.h:1921
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
FAST_MUTEX
Definition: extypes.h:17
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
* PFILE_OBJECT
Definition: iotypes.h:1998
enum _LOCK_OPERATION LOCK_OPERATION
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175