7 #include <pseh/pseh2.h>
10 #define INIT_SECTION __attribute__((section ("INIT")))
12 #define INIT_SECTION /* Done via alloc_text for MSC */
15 #define USE_ROS_CC_AND_FS
18 #define ENABLE_SWAPOUT
22 #define ROUND_DOWN(n, align) \
23 (((ULONG)n) & ~((align) - 1l))
25 #define ROUND_UP(n, align) \
26 ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
28 #define ROUND_DOWN_64(n, align) \
29 (((ULONGLONG)n) & ~((align) - 1LL))
31 #define ROUND_UP_64(n, align) \
32 ROUND_DOWN_64(((ULONGLONG)n) + (align) - 1LL, (align))
37 unsigned char magic0
, res0
, magic1
;
38 unsigned char OEMName
[8];
39 unsigned short BytesPerSector
;
40 unsigned char SectorsPerCluster
;
41 unsigned short ReservedSectors
;
42 unsigned char FATCount
;
43 unsigned short RootEntries
, Sectors
;
45 unsigned short FATSectors
, SectorsPerTrack
, Heads
;
46 unsigned long HiddenSectors
, SectorsHuge
;
47 unsigned char Drive
, Res1
, Sig
;
48 unsigned long VolumeID
;
49 unsigned char VolumeLabel
[11], SysType
[8];
50 unsigned char Res2
[448];
51 unsigned short Signatur1
;
56 unsigned char magic0
, res0
, magic1
; // 0
57 unsigned char OEMName
[8]; // 3
58 unsigned short BytesPerSector
; // 11
59 unsigned char SectorsPerCluster
; // 13
60 unsigned short ReservedSectors
; // 14
61 unsigned char FATCount
; // 16
62 unsigned short RootEntries
, Sectors
; // 17
63 unsigned char Media
; // 21
64 unsigned short FATSectors
, SectorsPerTrack
, Heads
; // 22
65 unsigned long HiddenSectors
, SectorsHuge
; // 28
66 unsigned long FATSectors32
; // 36
67 unsigned short ExtFlag
; // 40
68 unsigned short FSVersion
; // 42
69 unsigned long RootCluster
; // 44
70 unsigned short FSInfoSector
; // 48
71 unsigned short BootBackup
; // 50
72 unsigned char Res3
[12]; // 52
73 unsigned char Drive
; // 64
74 unsigned char Res4
; // 65
75 unsigned char ExtBootSignature
; // 66
76 unsigned long VolumeID
; // 67
77 unsigned char VolumeLabel
[11], SysType
[8]; // 71
78 unsigned char Res2
[420]; // 90
79 unsigned short Signature1
; // 510
82 struct _BootSectorFatX
84 unsigned char SysType
[4]; // 0
85 unsigned long VolumeID
; // 4
86 unsigned long SectorsPerCluster
; // 8
87 unsigned short FATCount
; // 12
88 unsigned long Unknown
; // 14
89 unsigned char Unused
[4078]; // 18
94 unsigned long ExtBootSignature2
; // 0
95 unsigned char Res6
[480]; // 4
96 unsigned long FSINFOSignature
; // 484
97 unsigned long FreeCluster
; // 488
98 unsigned long NextCluster
; // 492
99 unsigned char Res7
[12]; // 496
100 unsigned long Signatur2
; // 508
103 typedef struct _BootSector BootSector
;
109 struct { unsigned char Filename
[8], Ext
[3]; };
110 unsigned char ShortName
[11];
112 unsigned char Attrib
;
114 unsigned char CreationTimeMs
;
115 unsigned short CreationTime
,CreationDate
,AccessDate
;
118 unsigned short FirstClusterHigh
; // FAT32
119 unsigned short ExtendedAttributes
; // FAT12/FAT16
121 unsigned short UpdateTime
; //time create/update
122 unsigned short UpdateDate
; //date create/update
123 unsigned short FirstCluster
;
124 unsigned long FileSize
;
127 #define FAT_EAFILE "EA DATA. SF"
129 typedef struct _EAFileHeader FAT_EA_FILE_HEADER
, *PFAT_EA_FILE_HEADER
;
133 unsigned short Signature
; // ED
134 unsigned short Unknown
[15];
135 unsigned short EASetTable
[240];
138 typedef struct _EASetHeader FAT_EA_SET_HEADER
, *PFAT_EA_SET_HEADER
;
142 unsigned short Signature
; // EA
143 unsigned short Offset
; // relative offset, same value as in the EASetTable
144 unsigned short Unknown1
[2];
145 char TargetFileName
[12];
146 unsigned short Unknown2
[3];
147 unsigned int EALength
;
151 typedef struct _EAHeader FAT_EA_HEADER
, *PFAT_EA_HEADER
;
155 unsigned char Unknown
;
156 unsigned char EANameLength
;
157 unsigned short EAValueLength
;
162 typedef struct _FATDirEntry FAT_DIR_ENTRY
, *PFAT_DIR_ENTRY
;
166 unsigned char FilenameLength
; // 0
167 unsigned char Attrib
; // 1
168 unsigned char Filename
[42]; // 2
169 unsigned long FirstCluster
; // 44
170 unsigned long FileSize
; // 48
171 unsigned short UpdateTime
; // 52
172 unsigned short UpdateDate
; // 54
173 unsigned short CreationTime
; // 56
174 unsigned short CreationDate
; // 58
175 unsigned short AccessTime
; // 60
176 unsigned short AccessDate
; // 62
181 unsigned char id
; // sequence number for slot
182 WCHAR name0_4
[5]; // first 5 characters in name
183 unsigned char attr
; // attribute byte
184 unsigned char reserved
; // always 0
185 unsigned char alias_checksum
; // checksum for 8.3 alias
186 WCHAR name5_10
[6]; // 6 more characters in name
187 unsigned char start
[2]; // starting cluster number
188 WCHAR name11_12
[2]; // last 2 characters in name
191 typedef struct _slot slot
;
195 #define VFAT_CASE_LOWER_BASE 8 // base is lower case
196 #define VFAT_CASE_LOWER_EXT 16 // extension is lower case
198 #define LONGNAME_MAX_LENGTH 256 // max length for a long filename
200 #define ENTRY_DELETED(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ? FATX_ENTRY_DELETED(&((DirEntry)->FatX)) : FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
201 #define ENTRY_VOLUME(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ? FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) : FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
202 #define ENTRY_END(DeviceExt, DirEntry) (vfatVolumeIsFatX(DeviceExt) ? FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
204 #define ENTRY_DELETED2(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_DELETED(&((DirEntry)->FatX)) : FAT_ENTRY_DELETED(&((DirEntry)->Fat)))
205 #define ENTRY_VOLUME2(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_VOLUME(&((DirEntry)->FatX)) : FAT_ENTRY_VOLUME(&((DirEntry)->Fat)))
206 #define ENTRY_END2(IsFatX, DirEntry) (IsFatX ? FATX_ENTRY_END(&((DirEntry)->FatX)) : FAT_ENTRY_END(&((DirEntry)->Fat)))
208 #define FAT_ENTRY_DELETED(DirEntry) ((DirEntry)->Filename[0] == 0xe5)
209 #define FAT_ENTRY_END(DirEntry) ((DirEntry)->Filename[0] == 0)
210 #define FAT_ENTRY_LONG(DirEntry) (((DirEntry)->Attrib & 0x3f) == 0x0f)
211 #define FAT_ENTRY_VOLUME(DirEntry) (((DirEntry)->Attrib & 0x1f) == 0x08)
213 #define FATX_ENTRY_DELETED(DirEntry) ((DirEntry)->FilenameLength == 0xe5)
214 #define FATX_ENTRY_END(DirEntry) ((DirEntry)->FilenameLength == 0xff)
215 #define FATX_ENTRY_LONG(DirEntry) (FALSE)
216 #define FATX_ENTRY_VOLUME(DirEntry) (((DirEntry)->Attrib & 0x1f) == 0x08)
218 #define FAT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FAT_DIR_ENTRY))
219 #define FATX_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof (FATX_DIR_ENTRY))
221 typedef struct _FATXDirEntry FATX_DIR_ENTRY
, *PFATX_DIR_ENTRY
;
229 typedef union _DIR_ENTRY DIR_ENTRY
, *PDIR_ENTRY
;
231 #define BLOCKSIZE 512
239 #define VCB_VOLUME_LOCKED 0x0001
240 #define VCB_DISMOUNT_PENDING 0x0002
241 #define VCB_IS_FATX 0x0004
242 #define VCB_IS_DIRTY 0x4000 /* Volume is dirty */
243 #define VCB_CLEAR_DIRTY 0x8000 /* Clean dirty flag at shutdown */
248 CHAR VolumeLabel
[11];
252 ULONG rootDirectorySectors
;
256 ULONG SectorsPerCluster
;
257 ULONG BytesPerSector
;
258 ULONG BytesPerCluster
;
259 ULONG NumberOfClusters
;
263 } FATINFO
, *PFATINFO
;
266 struct _VFAT_DIRENTRY_CONTEXT
;
267 struct _VFAT_MOVE_CONTEXT
;
269 typedef struct _HASHENTRY
272 struct _VFATFCB
* self
;
273 struct _HASHENTRY
* next
;
277 typedef struct DEVICE_EXTENSION
*PDEVICE_EXTENSION
;
279 typedef NTSTATUS (*PGET_NEXT_CLUSTER
)(PDEVICE_EXTENSION
,ULONG
,PULONG
);
280 typedef NTSTATUS (*PFIND_AND_MARK_AVAILABLE_CLUSTER
)(PDEVICE_EXTENSION
,PULONG
);
281 typedef NTSTATUS (*PWRITE_CLUSTER
)(PDEVICE_EXTENSION
,ULONG
,ULONG
,PULONG
);
283 typedef BOOLEAN (*PIS_DIRECTORY_EMPTY
)(struct _VFATFCB
*);
284 typedef NTSTATUS (*PADD_ENTRY
)(PDEVICE_EXTENSION
,PUNICODE_STRING
,struct _VFATFCB
**,struct _VFATFCB
*,ULONG
,UCHAR
,struct _VFAT_MOVE_CONTEXT
*);
285 typedef NTSTATUS (*PDEL_ENTRY
)(PDEVICE_EXTENSION
,struct _VFATFCB
*,struct _VFAT_MOVE_CONTEXT
*);
286 typedef NTSTATUS (*PGET_NEXT_DIR_ENTRY
)(PVOID
*,PVOID
*,struct _VFATFCB
*,struct _VFAT_DIRENTRY_CONTEXT
*,BOOLEAN
);
288 typedef struct _VFAT_DISPATCH
290 PIS_DIRECTORY_EMPTY IsDirectoryEmpty
;
293 PGET_NEXT_DIR_ENTRY GetNextDirEntry
;
294 } VFAT_DISPATCH
, *PVFAT_DISPATCH
;
296 typedef struct DEVICE_EXTENSION
298 ERESOURCE DirResource
;
299 ERESOURCE FatResource
;
301 KSPIN_LOCK FcbListLock
;
302 LIST_ENTRY FcbListHead
;
304 struct _HASHENTRY
**FcbHashTable
;
306 PDEVICE_OBJECT VolumeDevice
;
307 PDEVICE_OBJECT StorageDevice
;
308 PFILE_OBJECT FATFileObject
;
310 ULONG LastAvailableCluster
;
311 ULONG AvailableClusters
;
312 BOOLEAN AvailableClustersValid
;
314 struct _VFATFCB
*VolumeFcb
;
316 /* Pointers to functions for manipulating FAT. */
317 PGET_NEXT_CLUSTER GetNextCluster
;
318 PFIND_AND_MARK_AVAILABLE_CLUSTER FindAndMarkAvailableCluster
;
319 PWRITE_CLUSTER WriteCluster
;
320 ULONG CleanShutBitMask
;
324 LIST_ENTRY VolumeListEntry
;
327 LIST_ENTRY NotifyList
;
328 PNOTIFY_SYNC NotifySync
;
330 /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLOSE */
331 ULONG OpenHandleCount
;
333 /* VPBs for dismount */
337 /* Pointers to functions for manipulating directory entries. */
338 VFAT_DISPATCH Dispatch
;
339 } DEVICE_EXTENSION
, VCB
, *PVCB
;
343 VfatIsDirectoryEmpty(PDEVICE_EXTENSION DeviceExt
,
344 struct _VFATFCB
* Fcb
)
346 return DeviceExt
->Dispatch
.IsDirectoryEmpty(Fcb
);
351 VfatAddEntry(PDEVICE_EXTENSION DeviceExt
,
352 PUNICODE_STRING NameU
,
353 struct _VFATFCB
** Fcb
,
354 struct _VFATFCB
* ParentFcb
,
355 ULONG RequestedOptions
,
357 struct _VFAT_MOVE_CONTEXT
* MoveContext
)
359 return DeviceExt
->Dispatch
.AddEntry(DeviceExt
, NameU
, Fcb
, ParentFcb
, RequestedOptions
, ReqAttr
, MoveContext
);
364 VfatDelEntry(PDEVICE_EXTENSION DeviceExt
,
365 struct _VFATFCB
* Fcb
,
366 struct _VFAT_MOVE_CONTEXT
* MoveContext
)
368 return DeviceExt
->Dispatch
.DelEntry(DeviceExt
, Fcb
, MoveContext
);
373 VfatGetNextDirEntry(PDEVICE_EXTENSION DeviceExt
,
376 struct _VFATFCB
* pDirFcb
,
377 struct _VFAT_DIRENTRY_CONTEXT
* DirContext
,
380 return DeviceExt
->Dispatch
.GetNextDirEntry(pContext
, pPage
, pDirFcb
, DirContext
, First
);
383 #define VFAT_BREAK_ON_CORRUPTION 1
387 PDRIVER_OBJECT DriverObject
;
388 PDEVICE_OBJECT DeviceObject
;
390 ERESOURCE VolumeListLock
;
391 LIST_ENTRY VolumeListHead
;
392 NPAGED_LOOKASIDE_LIST FcbLookasideList
;
393 NPAGED_LOOKASIDE_LIST CcbLookasideList
;
394 NPAGED_LOOKASIDE_LIST IrpContextLookasideList
;
395 FAST_IO_DISPATCH FastIoDispatch
;
396 CACHE_MANAGER_CALLBACKS CacheMgrCallbacks
;
397 } VFAT_GLOBAL_DATA
, *PVFAT_GLOBAL_DATA
;
399 extern PVFAT_GLOBAL_DATA VfatGlobalData
;
401 #define FCB_CACHE_INITIALIZED 0x0001
402 #define FCB_DELETE_PENDING 0x0002
403 #define FCB_IS_FAT 0x0004
404 #define FCB_IS_PAGE_FILE 0x0008
405 #define FCB_IS_VOLUME 0x0010
406 #define FCB_IS_DIRTY 0x0020
408 typedef struct _VFATFCB
410 /* FCB header required by ROS/NT */
411 FSRTL_COMMON_FCB_HEADER RFCB
;
412 SECTION_OBJECT_POINTERS SectionObjectPointers
;
413 ERESOURCE MainResource
;
414 ERESOURCE PagingIoResource
;
415 /* end FCB header required by ROS/NT */
417 /* directory entry for this file or directory */
420 /* Pointer to attributes in entry */
423 /* long file name, points into PathNameBuffer */
424 UNICODE_STRING LongNameU
;
426 /* short file name */
427 UNICODE_STRING ShortNameU
;
429 /* directory name, points into PathNameBuffer */
430 UNICODE_STRING DirNameU
;
432 /* path + long file name 260 max*/
433 UNICODE_STRING PathNameU
;
435 /* buffer for PathNameU */
436 PWCHAR PathNameBuffer
;
438 /* buffer for ShortNameU */
439 WCHAR ShortNameBuffer
[13];
444 /* List of FCB's for this volume */
445 LIST_ENTRY FcbListEntry
;
447 /* List of FCB's for the parent */
448 LIST_ENTRY ParentListEntry
;
450 /* pointer to the parent fcb */
451 struct _VFATFCB
*parentFcb
;
453 /* List for the children */
454 LIST_ENTRY ParentListHead
;
456 /* Flags for the fcb */
459 /* pointer to the file object which has initialized the fcb */
460 PFILE_OBJECT FileObject
;
462 /* Directory index for the short name entry */
465 /* Directory index where the long name starts */
468 /* Share access for the file object */
469 SHARE_ACCESS FCBShareAccess
;
471 /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */
472 ULONG OpenHandleCount
;
474 /* Entry into the hash table for the path + long name */
477 /* Entry into the hash table for the path + short name */
480 /* List of byte-range locks for this file */
484 * Optimization: caching of last read/write cluster+offset pair. Can't
485 * be in VFATCCB because it must be reset everytime the allocated clusters
488 FAST_MUTEX LastMutex
;
491 } VFATFCB
, *PVFATFCB
;
493 typedef struct _VFATCCB
495 LARGE_INTEGER CurrentByteOffset
;
496 /* for DirectoryControl */
498 /* for DirectoryControl */
499 UNICODE_STRING SearchPattern
;
500 } VFATCCB
, *PVFATCCB
;
502 #define TAG_CCB 'BCCV'
503 #define TAG_FCB 'BCFV'
504 #define TAG_IRP 'PRIV'
505 #define TAG_VFAT 'TAFV'
507 #define ENTRIES_PER_SECTOR (BLOCKSIZE / sizeof(FATDirEntry))
509 typedef struct __DOSTIME
517 typedef struct __DOSDATE
525 #define IRPCONTEXT_CANWAIT 0x0001
526 #define IRPCONTEXT_COMPLETE 0x0002
527 #define IRPCONTEXT_QUEUE 0x0004
528 #define IRPCONTEXT_PENDINGRETURNED 0x0008
533 PDEVICE_OBJECT DeviceObject
;
534 PDEVICE_EXTENSION DeviceExt
;
536 WORK_QUEUE_ITEM WorkQueueItem
;
537 PIO_STACK_LOCATION Stack
;
540 PFILE_OBJECT FileObject
;
544 } VFAT_IRP_CONTEXT
, *PVFAT_IRP_CONTEXT
;
546 typedef struct _VFAT_DIRENTRY_CONTEXT
551 UNICODE_STRING LongNameU
;
552 UNICODE_STRING ShortNameU
;
553 } VFAT_DIRENTRY_CONTEXT
, *PVFAT_DIRENTRY_CONTEXT
;
555 typedef struct _VFAT_MOVE_CONTEXT
562 } VFAT_MOVE_CONTEXT
, *PVFAT_MOVE_CONTEXT
;
566 VfatMarkIrpContextForQueue(PVFAT_IRP_CONTEXT IrpContext
)
568 PULONG Flags
= &IrpContext
->Flags
;
570 *Flags
&= ~IRPCONTEXT_COMPLETE
;
571 *Flags
|= IRPCONTEXT_QUEUE
;
573 return STATUS_PENDING
;
578 vfatFCBIsDirectory(PVFATFCB FCB
)
580 return BooleanFlagOn(*FCB
->Attributes
, FILE_ATTRIBUTE_DIRECTORY
);
585 vfatFCBIsReadOnly(PVFATFCB FCB
)
587 return BooleanFlagOn(*FCB
->Attributes
, FILE_ATTRIBUTE_READONLY
);
592 vfatVolumeIsFatX(PDEVICE_EXTENSION DeviceExt
)
594 return BooleanFlagOn(DeviceExt
->Flags
, VCB_IS_FATX
);
601 IN PDEVICE_OBJECT pDeviceObject
,
602 IN PLARGE_INTEGER ReadOffset
,
605 IN BOOLEAN Override
);
609 IN PVFAT_IRP_CONTEXT IrpContext
,
610 IN PLARGE_INTEGER ReadOffset
,
612 IN ULONG BufferOffset
,
616 VfatWriteDiskPartial(
617 IN PVFAT_IRP_CONTEXT IrpContext
,
618 IN PLARGE_INTEGER WriteOffset
,
619 IN ULONG WriteLength
,
620 IN ULONG BufferOffset
,
624 VfatBlockDeviceIoControl(
625 IN PDEVICE_OBJECT DeviceObject
,
627 IN PVOID InputBuffer
,
628 IN ULONG InputBufferSize
,
629 IN OUT PVOID OutputBuffer
,
630 IN OUT PULONG pOutputBufferSize
,
631 IN BOOLEAN Override
);
637 PVFAT_IRP_CONTEXT IrpContext
);
643 PVFAT_IRP_CONTEXT IrpContext
);
647 PDEVICE_EXTENSION DeviceExt
,
648 PFILE_OBJECT FileObject
);
654 PVFAT_IRP_CONTEXT IrpContext
);
658 PDEVICE_EXTENSION DeviceExt
,
660 PUNICODE_STRING FileToFindU
,
661 PVFAT_DIRENTRY_CONTEXT DirContext
,
666 PFAT_DIR_ENTRY pEntry
,
667 PUNICODE_STRING NameU
);
672 VfatDirectoryControl(
673 PVFAT_IRP_CONTEXT IrpContext
);
676 FsdDosDateTimeToSystemTime(
677 PDEVICE_EXTENSION DeviceExt
,
680 PLARGE_INTEGER SystemTime
);
683 FsdSystemTimeToDosDateTime(
684 PDEVICE_EXTENSION DeviceExt
,
685 PLARGE_INTEGER SystemTime
,
692 vfatDirEntryGetFirstCluster(
693 PDEVICE_EXTENSION pDeviceExt
,
694 PDIR_ENTRY pDirEntry
);
705 PDEVICE_EXTENSION DeviceExt
,
712 IN PDEVICE_EXTENSION DeviceExt
,
714 IN PUNICODE_STRING FileName
,
715 IN BOOLEAN CaseChangeOnly
);
719 IN PDEVICE_EXTENSION DeviceExt
,
721 IN PUNICODE_STRING FileName
,
722 IN PVFATFCB ParentFcb
);
727 VfatSetExtendedAttributes(
728 PFILE_OBJECT FileObject
,
735 VfatInitFastIoRoutines(
736 PFAST_IO_DISPATCH FastIoDispatch
);
740 VfatAcquireForLazyWrite(
746 VfatReleaseFromLazyWrite(
751 VfatAcquireForReadAhead(
757 VfatReleaseFromReadAhead(
764 PDEVICE_EXTENSION DeviceExt
,
765 ULONG CurrentCluster
,
769 FAT12FindAndMarkAvailableCluster(
770 PDEVICE_EXTENSION DeviceExt
,
775 PDEVICE_EXTENSION DeviceExt
,
776 ULONG ClusterToWrite
,
782 PDEVICE_EXTENSION DeviceExt
,
783 ULONG CurrentCluster
,
787 FAT16FindAndMarkAvailableCluster(
788 PDEVICE_EXTENSION DeviceExt
,
793 PDEVICE_EXTENSION DeviceExt
,
794 ULONG ClusterToWrite
,
800 PDEVICE_EXTENSION DeviceExt
,
801 ULONG CurrentCluster
,
805 FAT32FindAndMarkAvailableCluster(
806 PDEVICE_EXTENSION DeviceExt
,
811 PDEVICE_EXTENSION DeviceExt
,
812 ULONG ClusterToWrite
,
818 PDEVICE_EXTENSION DeviceExt
,
826 PDEVICE_EXTENSION DeviceExt
,
831 PDEVICE_EXTENSION DeviceExt
,
832 ULONG CurrentCluster
,
836 GetNextClusterExtend(
837 PDEVICE_EXTENSION DeviceExt
,
838 ULONG CurrentCluster
,
842 CountAvailableClusters(
843 PDEVICE_EXTENSION DeviceExt
,
844 PLARGE_INTEGER Clusters
);
848 PDEVICE_EXTENSION DeviceExt
,
849 ULONG ClusterToWrite
,
856 PDEVICE_EXTENSION pVCB
,
857 PUNICODE_STRING pFileNameU
);
860 vfatSetFCBNewDirName(
861 PDEVICE_EXTENSION pVCB
,
867 PDEVICE_EXTENSION pVCB
,
869 PVFAT_DIRENTRY_CONTEXT DirContext
,
882 PDEVICE_EXTENSION pVCB
,
887 PDEVICE_EXTENSION pVCB
,
891 vfatGrabFCBFromTable(
892 PDEVICE_EXTENSION pDeviceExt
,
893 PUNICODE_STRING pFileNameU
);
897 PDEVICE_EXTENSION pVCB
);
901 PDEVICE_EXTENSION pVCB
);
912 vfatAttachFCBToFileObject(
913 PDEVICE_EXTENSION vcb
,
915 PFILE_OBJECT fileObject
);
919 PDEVICE_EXTENSION pVCB
,
921 PUNICODE_STRING FileToFindU
,
926 PDEVICE_EXTENSION pVCB
,
927 PVFATFCB
*pParentFCB
,
929 PUNICODE_STRING pFileNameU
);
932 vfatMakeFCBFromDirEntry(
934 PVFATFCB directoryFCB
,
935 PVFAT_DIRENTRY_CONTEXT DirContext
,
941 VfatGetStandardInformation(
943 PFILE_STANDARD_INFORMATION StandardInfo
,
944 PULONG BufferLength
);
947 VfatGetBasicInformation(
948 PFILE_OBJECT FileObject
,
950 PDEVICE_OBJECT DeviceObject
,
951 PFILE_BASIC_INFORMATION BasicInfo
,
952 PULONG BufferLength
);
955 VfatQueryInformation(
956 PVFAT_IRP_CONTEXT IrpContext
);
960 PVFAT_IRP_CONTEXT IrpContext
);
963 VfatSetAllocationSizeInformation(
964 PFILE_OBJECT FileObject
,
966 PDEVICE_EXTENSION DeviceExt
,
967 PLARGE_INTEGER AllocationSize
);
973 PVFAT_IRP_CONTEXT IrpContext
);
977 PDEVICE_EXTENSION DeviceExt
,
983 VfatFileSystemControl(
984 PVFAT_IRP_CONTEXT IrpContext
);
991 PDRIVER_OBJECT DriverObject
,
992 PUNICODE_STRING RegistryPath
);
1003 PDEVICE_OBJECT DeviceObject
,
1018 VfatCheckForDismount(
1019 IN PDEVICE_EXTENSION DeviceExt
,
1026 PVFAT_IRP_CONTEXT IrpContext
);
1032 PVFAT_IRP_CONTEXT IrpContext
);
1036 PVFAT_IRP_CONTEXT IrpContext
);
1040 PDEVICE_EXTENSION DeviceExt
,
1042 PULONG CurrentCluster
,
1053 PDEVICE_OBJECT DeviceObject
,
1060 PUNICODE_STRING PathNameU
,
1061 PUNICODE_STRING DirNameU
,
1062 PUNICODE_STRING FileNameU
);
1076 VfatQueryVolumeInformation(
1077 PVFAT_IRP_CONTEXT IrpContext
);
1080 VfatSetVolumeInformation(
1081 PVFAT_IRP_CONTEXT IrpContext
);
1083 #endif /* _FASTFAT_PCH_ */