ReactOS 0.4.16-dev-251-ga17b6e9
fatprocs.h
Go to the documentation of this file.
1/*++
2
3Copyright (c) 1989-2000 Microsoft Corporation
4
5Module Name:
6
7 FatProcs.h
8
9Abstract:
10
11 This module defines all of the globally used procedures in the FAT
12 file system.
13
14
15--*/
16
17#ifndef _FATPROCS_
18#define _FATPROCS_
19
20#ifdef _MSC_VER
21#pragma warning( disable: 4127 ) // conditional expression is constant
22
23#pragma warning( push )
24#pragma warning( disable: 4201 ) // nonstandard extension used : nameless struct/union
25#pragma warning( disable: 4214 ) // nonstandard extension used : bit field types
26#endif
27
28#include <ntifs.h>
29
30
31#include <ntddscsi.h>
32#include <scsi.h>
33#include <ntddcdrm.h>
34#include <ntdddisk.h>
35#include <ntddstor.h>
36#include <ntintsafe.h>
37#ifdef __REACTOS__
38#include <pseh/pseh2.h>
39#include <dbgbitmap.h>
40#endif
41
42
43#ifdef __REACTOS__
44// Downgrade unsupported NT6.2+ features.
45#undef MdlMappingNoExecute
46#define MdlMappingNoExecute 0
47#define NonPagedPoolNx NonPagedPool
48#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
49#undef POOL_NX_ALLOCATION
50#define POOL_NX_ALLOCATION 0
51
52// Moved up: needed in 'fatstruc.h'.
53typedef enum _TYPE_OF_OPEN {
54
61 EaFile,
63#endif
64
65#include "nodetype.h"
66#include "fat.h"
67#include "lfn.h"
68#include "fatstruc.h"
69#include "fatdata.h"
70
71
72
73#ifdef _MSC_VER
74#pragma warning( pop )
75#endif
76
77#ifndef INLINE
78#define INLINE __inline
79#endif
80
81#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
82
83#ifndef MAX_ULONG
84#define MAX_ULONG ((ULONG)-1)
85#endif
86
87#ifndef MAX_USHORT
88#define MAX_USHORT ((USHORT)-1)
89#endif
90
91//
92// We must explicitly tag our allocations.
93//
94
95#undef FsRtlAllocatePool
96#undef FsRtlAllocatePoolWithQuota
97
98//
99// A function that returns finished denotes if it was able to complete the
100// operation (TRUE) or could not complete the operation (FALSE) because the
101// wait value stored in the irp context was false and we would have had
102// to block for a resource or I/O
103//
104
106
107//
108// Size (characters) of stack allocated name component buffers in
109// the create/rename paths.
110//
111
112#define FAT_CREATE_INITIAL_NAME_BUF_SIZE 32
113
114
115//
116// Some string buffer handling functions, implemented in strucsup.c
117//
118
119VOID
122 );
123
124VOID
127 _In_ USHORT DesiredBufferSize,
128 _In_ BOOLEAN FreeOldBuffer,
129 __out_opt PBOOLEAN NeedsFree
130 );
131
132VOID
135 _In_ USHORT DesiredBufferSize
136 );
137
140 IN PVCB Vcb,
142 IN VBO Vbo,
143 IN LBO Lbo,
145 );
146
149 IN PVCB Vcb,
151 IN VBO Vbo,
152 OUT PLBO Lbo,
155 );
156
159 IN PVCB Vcb,
161 OUT PVBO Vbo,
162 OUT PLBO Lbo,
164 );
165
168 IN PVCB Vcb,
171 OUT PVBO Vbo,
172 OUT PLBO Lbo,
174 );
175
176VOID
178 IN PVCB Vcb,
180 IN VBO Vbo,
182 );
183
184
185//
186// File access check routine, implemented in AcChkSup.c
187//
188
191 PIRP_CONTEXT IrpContext,
192 IN UCHAR DirentAttributes,
194 );
195
198 _In_ PIRP_CONTEXT IrpContext,
200 _In_ KPROCESSOR_MODE ProcessorMode
201 );
202
205 IN PIRP_CONTEXT IrpContext,
208 IN KPROCESSOR_MODE ProcessorMode
209 );
210
211
212//
213// Allocation support routines, implemented in AllocSup.c
214//
215
216static
217INLINE
220 IN PVCB Vcb,
223 )
224
225/*++
226
227Routine Description:
228
229 This routine enforces the restriction that object space must be
230 representable in 32 bits.
231
232Arguments:
233
234 Vcb - the volume the range is on
235
236 Start - starting byte (zero based) of the range
237
238 Length - size of the range
239
240 HeaderSize - if the file has a header
241
242Return Value:
243
244 BOOLEAN - if, considering the cluster size, the neccesary size of
245 the object to contain the range can be represented in 32 bits.
246
247--*/
248
249{
250
252
253 //
254 // The only restriction on a FAT object is that the filesize must
255 // fit in 32bits, i.e. <= 0xffffffff. This then implies that the
256 // range of valid byte offsets is [0, fffffffe].
257 //
258 // Two phases which check for illegality
259 //
260 // - if the high 32bits are nonzero
261 // - if the length would cause a 32bit overflow
262 //
263
264 return !(Start.HighPart ||
265 Start.LowPart + Length < Start.LowPart);
266}
267
268
269//
270// This strucure is used by FatLookupFatEntry to remember a pinned page
271// of fat.
272//
273
275
279
281
282VOID
284 IN PIRP_CONTEXT IrpContext,
285 IN PVCB Vcb,
289 );
290
291VOID
293 IN PIRP_CONTEXT IrpContext,
294 IN PVCB Vcb
295 );
296
297VOID
299 IN PIRP_CONTEXT IrpContext,
300 IN PVCB Vcb
301 );
302
303_Requires_lock_held_(_Global_critical_region_)
304VOID
305FatLookupFileAllocation (
306 IN PIRP_CONTEXT IrpContext,
314 );
315
316_Requires_lock_held_(_Global_critical_region_)
317VOID
318FatAddFileAllocation (
319 IN PIRP_CONTEXT IrpContext,
323 );
324
325_Requires_lock_held_(_Global_critical_region_)
326VOID
327FatTruncateFileAllocation (
328 IN PIRP_CONTEXT IrpContext,
331 );
332
333_Requires_lock_held_(_Global_critical_region_)
334VOID
335FatLookupFileAllocationSize (
336 IN PIRP_CONTEXT IrpContext,
338 );
339
340_Requires_lock_held_(_Global_critical_region_)
341VOID
342FatAllocateDiskSpace (
343 IN PIRP_CONTEXT IrpContext,
349 );
350
351_Requires_lock_held_(_Global_critical_region_)
352VOID
353FatDeallocateDiskSpace (
354 IN PIRP_CONTEXT IrpContext,
355 IN PVCB Vcb,
358 );
359
360_Requires_lock_held_(_Global_critical_region_)
361VOID
362FatSplitAllocation (
363 IN PIRP_CONTEXT IrpContext,
364 IN PVCB Vcb,
368 );
369
370_Requires_lock_held_(_Global_critical_region_)
371VOID
372FatMergeAllocation (
373 IN PIRP_CONTEXT IrpContext,
374 IN PVCB Vcb,
377 );
378
379_Requires_lock_held_(_Global_critical_region_)
380VOID
381FatSetFatEntry (
382 IN PIRP_CONTEXT IrpContext,
383 IN PVCB Vcb,
386 );
387
388UCHAR
391 );
392
393
394//
395// Buffer control routines for data caching, implemented in CacheSup.c
396//
397
398VOID
400 IN PIRP_CONTEXT IrpContext,
401 IN PVCB Vcb,
404 OUT PBCB *Bcb,
406 );
407
408_Requires_lock_held_(_Global_critical_region_)
409VOID
410FatPrepareWriteVolumeFile (
411 IN PIRP_CONTEXT IrpContext,
412 IN PVCB Vcb,
419 );
420
421_Requires_lock_held_(_Global_critical_region_)
422VOID
423FatReadDirectoryFile (
424 IN PIRP_CONTEXT IrpContext,
429 OUT PBCB *Bcb,
432 );
433
434_Requires_lock_held_(_Global_critical_region_)
435VOID
436FatPrepareWriteDirectoryFile (
437 IN PIRP_CONTEXT IrpContext,
438 IN PDCB Dcb,
441 OUT PBCB *Bcb,
446 );
447
448_Requires_lock_held_(_Global_critical_region_)
449VOID
450FatOpenDirectoryFile (
451 IN PIRP_CONTEXT IrpContext,
452 IN PDCB Dcb
453 );
454
457 IN PIRP_CONTEXT IrpContext,
458 IN PFCB EaFcb
459 );
460
461VOID
463 IN PIRP_CONTEXT IrpContext,
464 IN PVCB Vcb,
465 IN BOOLEAN FlushFirst
466 );
467
468
469_Requires_lock_held_(_Global_critical_region_)
470VOID
471FatSetDirtyBcb (
472 IN PIRP_CONTEXT IrpContext,
473 IN PBCB Bcb,
476 );
477
478VOID
480 IN PIRP_CONTEXT IrpContext,
481 IN PBCB Bcb
482 );
483
484VOID
486 IN PIRP_CONTEXT IrpContext
487 );
488
491 IN PIRP_CONTEXT IrpContext,
492 IN PVCB Vcb,
494 IN ULONG StartingZero,
496 );
497
500 IN PIRP_CONTEXT IrpContext,
501 IN PIRP Irp
502 );
503
504VOID
506 IN PIRP_CONTEXT IrpContext,
507 IN PDCB Dcb,
510 OUT PBCB *Bcb
511 );
512
515 IN PIRP_CONTEXT IrpContext,
517 IN ULONG StartingPage,
518 IN ULONG PageCount
519 );
520
521//
522// VOID
523// FatUnpinBcb (
524// IN PIRP_CONTEXT IrpContext,
525// IN OUT PBCB Bcb,
526// );
527//
528
529//
530// This macro unpins a Bcb, in the checked build make sure all
531// requests unpin all Bcbs before leaving.
532//
533
534#if DBG
535
536#define FatUnpinBcb(IRPCONTEXT,BCB) { \
537 if ((BCB) != NULL) { \
538 CcUnpinData((BCB)); \
539 NT_ASSERT( (IRPCONTEXT)->PinCount );\
540 (IRPCONTEXT)->PinCount -= 1; \
541 (BCB) = NULL; \
542 } \
543}
544
545#else
546
547#define FatUnpinBcb(IRPCONTEXT,BCB) { \
548 if ((BCB) != NULL) { \
549 CcUnpinData((BCB)); \
550 (BCB) = NULL; \
551 } \
552}
553
554#endif // DBG
555
556VOID
560 _In_ BOOLEAN PinAccess,
562 _In_ PVOID LazyWriteContext
563 );
564
565VOID
567 IN PIRP_CONTEXT IrpContext,
569 );
570
571
572//
573// Device I/O routines, implemented in DevIoSup.c
574//
575// These routines perform the actual device read and writes. They only affect
576// the on disk structure and do not alter any other data structures.
577//
578
579VOID
581 IN PIRP Irp,
582 IN PFCB Fcb
583 );
584
585
586_Requires_lock_held_(_Global_critical_region_)
588FatNonCachedIo (
589 IN PIRP_CONTEXT IrpContext,
596 );
597
598_Requires_lock_held_(_Global_critical_region_)
599VOID
600FatNonCachedNonAlignedRead (
601 IN PIRP_CONTEXT IrpContext,
602 IN PIRP Irp,
606 );
607
608VOID
610 IN PIRP_CONTEXT IrpContext,
611 IN PVCB Vcb,
612 IN PIRP Irp,
613 IN ULONG MultipleIrpCount,
614 IN PIO_RUN IoRuns
615 );
616
617VOID
619 IN PIRP_CONTEXT IrpContext,
620 IN PVCB Vcb,
621 IN LBO Lbo,
623 IN PIRP Irp
624 );
625
626VOID
628 IN PIRP_CONTEXT IrpContext
629 );
630
631VOID
633 IN PIRP_CONTEXT IrpContext,
634 IN OUT PIRP Irp,
637 );
638
639PVOID
641 IN PIRP_CONTEXT IrpContext,
642 IN OUT PIRP Irp,
644 );
645
646PVOID
648 IN PIRP_CONTEXT IrpContext,
649 IN OUT PIRP Irp
650 );
651
654 IN PIRP_CONTEXT IrpContext,
655 IN PVCB Vcb,
656 IN BOOLEAN PreventRemoval
657 );
658
661 IN PIRP_CONTEXT IrpContext,
669 IN BOOLEAN OverrideVerify,
671 );
672
673PMDL
675 __in PIRP_CONTEXT IrpContext,
677 );
678
679
680//
681// Dirent support routines, implemented in DirSup.c
682//
683
684//
685// Tunneling is a deletion precursor (all tunneling cases do
686// not involve deleting dirents, however)
687//
688
689VOID
693 );
694
695_Requires_lock_held_(_Global_critical_region_)
696ULONG
697FatCreateNewDirent (
698 IN PIRP_CONTEXT IrpContext,
702 );
703
704_Requires_lock_held_(_Global_critical_region_)
705VOID
706FatInitializeDirectoryDirent (
707 IN PIRP_CONTEXT IrpContext,
708 IN PDCB Dcb,
710 );
711
712_Requires_lock_held_(_Global_critical_region_)
713VOID
714FatDeleteDirent (
715 IN PIRP_CONTEXT IrpContext,
719 );
720
721
722_Requires_lock_held_(_Global_critical_region_)
723VOID
724FatLocateDirent (
725 IN PIRP_CONTEXT IrpContext,
731 OUT PBCB *Bcb,
733 OUT PBOOLEAN FileNameDos OPTIONAL,
736 );
737
738_Requires_lock_held_(_Global_critical_region_)
739VOID
740FatLocateSimpleOemDirent (
741 IN PIRP_CONTEXT IrpContext,
745 OUT PBCB *Bcb,
747 );
748
749_Requires_lock_held_(_Global_critical_region_)
751FatLfnDirentExists (
752 IN PIRP_CONTEXT IrpContext,
753 IN PDCB Dcb,
756 );
757
758_Requires_lock_held_(_Global_critical_region_)
759VOID
760FatLocateVolumeLabel (
761 IN PIRP_CONTEXT IrpContext,
762 IN PVCB Vcb,
764 OUT PBCB *Bcb,
766 );
767
768_Requires_lock_held_(_Global_critical_region_)
769VOID
770FatGetDirentFromFcbOrDcb (
771 IN PIRP_CONTEXT IrpContext,
775 OUT PBCB *Bcb
776 );
777
778_Requires_lock_held_(_Global_critical_region_)
780FatIsDirectoryEmpty (
781 IN PIRP_CONTEXT IrpContext,
782 IN PDCB Dcb
783 );
784
785_Requires_lock_held_(_Global_critical_region_)
786VOID
787FatDeleteFile (
788 IN PIRP_CONTEXT IrpContext,
794 );
795
796
797VOID
799 IN PIRP_CONTEXT IrpContext,
802 IN BOOLEAN ComponentReallyLowercase,
803 IN BOOLEAN ExtensionReallyLowercase,
806 IN BOOLEAN ZeroAndSetTimeFields,
807 IN PLARGE_INTEGER SetCreationTime OPTIONAL
808 );
809
810VOID
812 IN PIRP_CONTEXT IrpContext,
815 );
816
817_Requires_lock_held_(_Global_critical_region_)
818VOID
819FatSetFileSizeInDirent (
820 IN PIRP_CONTEXT IrpContext,
822 IN PULONG AlternativeFileSize OPTIONAL
823 );
824
825_Requires_lock_held_(_Global_critical_region_)
826VOID
827FatSetFileSizeInDirentNoRaise (
828 IN PIRP_CONTEXT IrpContext,
829 IN PFCB Fcb,
830 IN PULONG AlternativeFileSize OPTIONAL
831 );
832
833
834_Requires_lock_held_(_Global_critical_region_)
835VOID
836FatUpdateDirentFromFcb (
837 IN PIRP_CONTEXT IrpContext,
840 IN PCCB Ccb
841 );
842
843
844//
845// Generate a relatively unique static 64bit ID from a FAT Fcb/Dcb
846//
847// ULONGLONG
848// FatDirectoryKey (FcbOrDcb);
849//
850
851#define FatDirectoryKey(FcbOrDcb) ((ULONGLONG)((FcbOrDcb)->CreationTime.QuadPart ^ (FcbOrDcb)->FirstClusterOfFile))
852
853
854//
855// The following routines are used to access and manipulate the
856// clusters containing EA data in the ea data file. They are
857// implemented in EaSup.c
858//
859
860//
861// VOID
862// FatUpcaseEaName (
863// IN PIRP_CONTEXT IrpContext,
864// IN POEM_STRING EaName,
865// OUT POEM_STRING UpcasedEaName
866// );
867//
868
869#define FatUpcaseEaName( IRPCONTEXT, NAME, UPCASEDNAME ) \
870 RtlUpperString( UPCASEDNAME, NAME )
871
872_Requires_lock_held_(_Global_critical_region_)
873VOID
874FatGetEaLength (
875 IN PIRP_CONTEXT IrpContext,
876 IN PVCB Vcb,
879 );
880
881_Requires_lock_held_(_Global_critical_region_)
882VOID
883FatGetNeedEaCount (
884 IN PIRP_CONTEXT IrpContext,
885 IN PVCB Vcb,
888 );
889
890_Requires_lock_held_(_Global_critical_region_)
891VOID
892FatCreateEa (
893 IN PIRP_CONTEXT IrpContext,
894 IN PVCB Vcb,
899 );
900
901_Requires_lock_held_(_Global_critical_region_)
902VOID
903FatDeleteEa (
904 IN PIRP_CONTEXT IrpContext,
905 IN PVCB Vcb,
908 );
909
910_Requires_lock_held_(_Global_critical_region_)
911VOID
912FatGetEaFile (
913 IN PIRP_CONTEXT IrpContext,
914 IN OUT PVCB Vcb,
919 );
920
921VOID
923 IN PIRP_CONTEXT IrpContext,
924 IN PVCB Vcb,
927 IN BOOLEAN ReturnEntireSet,
929 );
930
931_Requires_lock_held_(_Global_critical_region_)
932VOID
933FatDeleteEaSet (
934 IN PIRP_CONTEXT IrpContext,
935 IN PVCB Vcb,
936 IN PBCB EaBcb,
940 );
941
942_Requires_lock_held_(_Global_critical_region_)
943VOID
944FatAddEaSet (
945 IN PIRP_CONTEXT IrpContext,
946 IN PVCB Vcb,
948 IN PBCB EaBcb,
952 );
953
954VOID
956 IN PIRP_CONTEXT IrpContext,
957 IN OUT PEA_SET_HEADER EaSetHeader,
958 IN OUT PULONG PackedEasLength,
960 );
961
962VOID
964 IN PIRP_CONTEXT IrpContext,
965 IN OUT PEA_SET_HEADER *EaSetHeader,
966 IN OUT PULONG PackedEasLength,
967 IN OUT PULONG AllocationLength,
969 IN ULONG BytesPerCluster
970 );
971
972ULONG
974 IN PIRP_CONTEXT IrpContext,
975 IN PPACKED_EA FirstPackedEa,
976 IN ULONG PackedEasLength,
977 IN ULONG PreviousOffset
978 );
979
982 IN PIRP_CONTEXT IrpContext,
983 IN PPACKED_EA FirstPackedEa,
984 IN ULONG PackedEasLength,
985 IN POEM_STRING EaName,
987 );
988
991 IN PIRP_CONTEXT IrpContext,
993 );
994
995VOID
997 IN PIRP_CONTEXT IrpContext,
998 IN PFILE_OBJECT VirtualEaFile,
999 IN PFCB EaFcb,
1000 IN OUT PEA_RANGE EaRange,
1002 IN ULONG Length,
1003 IN NTSTATUS ErrorStatus
1004 );
1005
1006VOID
1008 IN PIRP_CONTEXT IrpContext,
1009 IN PFILE_OBJECT EaFileObject,
1010 IN OUT PEA_RANGE EaRange
1011 );
1012
1013VOID
1015 IN PIRP_CONTEXT IrpContext,
1016 IN OUT PEA_RANGE EaRange
1017 );
1018
1019//
1020// The following macro computes the size of a full ea (not including
1021// padding to bring it to a longword. A full ea has a 4 byte offset,
1022// folowed by 1 byte flag, 1 byte name length, 2 bytes value length,
1023// the name, 1 null byte, and the value.
1024//
1025// ULONG
1026// SizeOfFullEa (
1027// IN PFILE_FULL_EA_INFORMATION FullEa
1028// );
1029//
1030
1031#define SizeOfFullEa(EA) (4+1+1+2+(EA)->EaNameLength+1+(EA)->EaValueLength)
1032
1033
1034//
1035// The following routines are used to manipulate the fscontext fields
1036// of the file object, implemented in FilObSup.c
1037//
1038
1039#ifndef __REACTOS__
1040typedef enum _TYPE_OF_OPEN {
1041
1050#endif
1051
1052typedef enum _FAT_FLUSH_TYPE {
1053
1058
1060
1061VOID
1065 IN PVOID VcbOrFcbOrDcb,
1067 );
1068
1072 _Outptr_ PVCB *Vcb,
1075 );
1076
1077_Requires_lock_held_(_Global_critical_region_)
1078VOID
1079FatPurgeReferencedFileObjects (
1080 IN PIRP_CONTEXT IrpContext,
1083 );
1084
1085_Requires_lock_held_(_Global_critical_region_)
1086VOID
1087FatForceCacheMiss (
1088 IN PIRP_CONTEXT IrpContext,
1089 IN PFCB Fcb,
1091 );
1092
1093
1094//
1095// File system control routines, implemented in FsCtrl.c
1096//
1097
1098_Requires_lock_held_(_Global_critical_region_)
1099VOID
1100FatFlushAndCleanVolume(
1101 IN PIRP_CONTEXT IrpContext,
1102 IN PIRP Irp,
1103 IN PVCB Vcb,
1105 );
1106
1107BOOLEAN
1110 );
1111
1112_Requires_lock_held_(_Global_critical_region_)
1114FatLockVolumeInternal (
1115 IN PIRP_CONTEXT IrpContext,
1116 IN PVCB Vcb,
1118 );
1119
1122 IN PIRP_CONTEXT IrpContext,
1123 IN PVCB Vcb,
1125 );
1126
1127
1128//
1129// Name support routines, implemented in NameSup.c
1130//
1131
1132//
1133// BOOLEAN
1134// FatAreNamesEqual (
1135// IN PIRP_CONTEXT IrpContext,
1136// IN OEM_STRING ConstantNameA,
1137// IN OEM_STRING ConstantNameB
1138// )
1139//
1140// /*++
1141//
1142// Routine Description:
1143//
1144// This routine simple returns whether the two names are exactly equal.
1145// If the two names are known to be constant, this routine is much
1146// faster than FatIsDbcsInExpression.
1147//
1148// Arguments:
1149//
1150// ConstantNameA - Constant name.
1151//
1152// ConstantNameB - Constant name.
1153//
1154// Return Value:
1155//
1156// BOOLEAN - TRUE if the two names are lexically equal.
1157//
1158
1159#define FatAreNamesEqual(IRPCONTEXT,NAMEA,NAMEB) ( \
1160 ((ULONG)(NAMEA).Length == (ULONG)(NAMEB).Length) && \
1161 (RtlEqualMemory( &(NAMEA).Buffer[0], \
1162 &(NAMEB).Buffer[0], \
1163 (NAMEA).Length )) \
1164)
1165
1166//
1167// BOOLEAN
1168// FatIsNameShortOemValid (
1169// IN PIRP_CONTEXT IrpContext,
1170// IN OEM_STRING Name,
1171// IN BOOLEAN CanContainWildCards,
1172// IN BOOLEAN PathNamePermissible,
1173// IN BOOLEAN LeadingBackslashPermissible
1174// )
1175//
1176// /*++
1177//
1178// Routine Description:
1179//
1180// This routine scans the input name and verifies that if only
1181// contains valid characters
1182//
1183// Arguments:
1184//
1185// Name - Supplies the input name to check.
1186//
1187// CanContainWildCards - Indicates if the name can contain wild cards
1188// (i.e., * and ?).
1189//
1190// Return Value:
1191//
1192// BOOLEAN - Returns TRUE if the name is valid and FALSE otherwise.
1193//
1194// --*/
1195//
1196// The FatIsNameLongOemValid and FatIsNameLongUnicodeValid are similar.
1197//
1198
1199#define FatIsNameShortOemValid(IRPCONTEXT,NAME,CAN_CONTAIN_WILD_CARDS,PATH_NAME_OK,LEADING_BACKSLASH_OK) ( \
1200 FsRtlIsFatDbcsLegal((NAME), \
1201 (CAN_CONTAIN_WILD_CARDS), \
1202 (PATH_NAME_OK), \
1203 (LEADING_BACKSLASH_OK)) \
1204)
1205
1206#define FatIsNameLongOemValid(IRPCONTEXT,NAME,CAN_CONTAIN_WILD_CARDS,PATH_NAME_OK,LEADING_BACKSLASH_OK) ( \
1207 FsRtlIsHpfsDbcsLegal((NAME), \
1208 (CAN_CONTAIN_WILD_CARDS), \
1209 (PATH_NAME_OK), \
1210 (LEADING_BACKSLASH_OK)) \
1211)
1212
1213static
1214INLINE
1215BOOLEAN
1217 PIRP_CONTEXT IrpContext,
1219 BOOLEAN CanContainWildcards,
1220 BOOLEAN PathNameOk,
1221 BOOLEAN LeadingBackslashOk
1222 )
1223{
1224 ULONG i;
1225
1226 UNREFERENCED_PARAMETER( IrpContext );
1227 UNREFERENCED_PARAMETER( LeadingBackslashOk );
1228 UNREFERENCED_PARAMETER( PathNameOk );
1229
1230 //
1231 // I'm not bothering to do the whole thing, just enough to make this call look
1232 // the same as the others.
1233 //
1234
1235 NT_ASSERT( !PathNameOk && !LeadingBackslashOk );
1236
1237 for (i=0; i < Name->Length/sizeof(WCHAR); i++) {
1238
1239 if ((Name->Buffer[i] < 0x80) &&
1240 !(FsRtlIsAnsiCharacterLegalHpfs(Name->Buffer[i], CanContainWildcards))) {
1241
1242 return FALSE;
1243 }
1244 }
1245
1246 return TRUE;
1247}
1248
1249BOOLEAN
1251 IN PIRP_CONTEXT IrpContext,
1254 );
1255
1256VOID
1258 _In_ PIRP_CONTEXT IrpContext,
1259 _In_ OEM_STRING InputString,
1260 _Out_writes_bytes_(11) PFAT8DOT3 Output8dot3
1261 );
1262
1263VOID
1265 _In_ PIRP_CONTEXT IrpContext,
1267 _In_ BOOLEAN RestoreCase,
1268 _Out_ POEM_STRING OutputString
1269 );
1270
1271_Requires_lock_held_(_Global_critical_region_)
1272VOID
1273FatGetUnicodeNameFromFcb (
1274 IN PIRP_CONTEXT IrpContext,
1275 IN PFCB Fcb,
1277 );
1278
1279_Requires_lock_held_(_Global_critical_region_)
1280VOID
1281FatSetFullFileNameInFcb (
1282 IN PIRP_CONTEXT IrpContext,
1283 IN PFCB Fcb
1284 );
1285
1286VOID
1288 _In_ PIRP_CONTEXT IrpContext,
1290 _In_ PUNICODE_STRING FinalName
1291 );
1292
1293VOID
1295 IN PIRP_CONTEXT IrpContext,
1298 );
1299
1300_Requires_lock_held_(_Global_critical_region_)
1301VOID
1302FatSelectNames (
1303 IN PIRP_CONTEXT IrpContext,
1308 IN PUNICODE_STRING SuggestedShortName OPTIONAL,
1312 );
1313
1314VOID
1316 IN PIRP_CONTEXT IrpContext,
1321 );
1322
1323BOOLEAN
1325 IN PIRP_CONTEXT IrpContext,
1327 );
1328
1329VOID
1331 IN PUNICODE_STRING ShortNameWithCase,
1332 IN BOOLEAN LowerCase8,
1333 IN BOOLEAN LowerCase3
1334 );
1335
1336
1337//
1338// Resources support routines/macros, implemented in ResrcSup.c
1339//
1340// The following routines/macros are used for gaining shared and exclusive
1341// access to the global/vcb data structures. The routines are implemented
1342// in ResrcSup.c. There is a global resources that everyone tries to take
1343// out shared to do their work, with the exception of mount/dismount which
1344// take out the global resource exclusive. All other resources only work
1345// on their individual item. For example, an Fcb resource does not take out
1346// a Vcb resource. But the way the file system is structured we know
1347// that when we are processing an Fcb other threads cannot be trying to remove
1348// or alter the Fcb, so we do not need to acquire the Vcb.
1349//
1350// The procedures/macros are:
1351//
1352// Macro FatData Vcb Fcb Subsequent macros
1353//
1354// AcquireExclusiveGlobal Read/Write None None ReleaseGlobal
1355//
1356// AcquireSharedGlobal Read None None ReleaseGlobal
1357//
1358// AcquireExclusiveVcb Read Read/Write None ReleaseVcb
1359//
1360// AcquireSharedVcb Read Read None ReleaseVcb
1361//
1362// AcquireExclusiveFcb Read None Read/Write ConvertToSharFcb
1363// ReleaseFcb
1364//
1365// AcquireSharedFcb Read None Read ReleaseFcb
1366//
1367// ConvertToSharedFcb Read None Read ReleaseFcb
1368//
1369// ReleaseGlobal
1370//
1371// ReleaseVcb
1372//
1373// ReleaseFcb
1374//
1375
1376//
1377// FINISHED
1378// FatAcquireExclusiveGlobal (
1379// IN PIRP_CONTEXT IrpContext
1380// );
1381//
1382// FINISHED
1383// FatAcquireSharedGlobal (
1384// IN PIRP_CONTEXT IrpContext
1385// );
1386//
1387
1388#define FatAcquireExclusiveGlobal(IRPCONTEXT) ( \
1389 ExAcquireResourceExclusiveLite( &FatData.Resource, BooleanFlagOn((IRPCONTEXT)->Flags, IRP_CONTEXT_FLAG_WAIT) ) \
1390)
1391
1392#define FatAcquireSharedGlobal(IRPCONTEXT) ( \
1393 ExAcquireResourceSharedLite( &FatData.Resource, BooleanFlagOn((IRPCONTEXT)->Flags, IRP_CONTEXT_FLAG_WAIT) ) \
1394)
1395
1396//
1397// The following macro must only be called when Wait is TRUE!
1398//
1399// FatAcquireExclusiveVolume (
1400// IN PIRP_CONTEXT IrpContext,
1401// IN PVCB Vcb
1402// );
1403//
1404// FatReleaseVolume (
1405// IN PIRP_CONTEXT IrpContext,
1406// IN PVCB Vcb
1407// );
1408//
1409
1410#define FatAcquireExclusiveVolume(IRPCONTEXT,VCB) { \
1411 PFCB __FFFFFcb = NULL; \
1412 NT_ASSERT(FlagOn((IRPCONTEXT)->Flags, IRP_CONTEXT_FLAG_WAIT)); \
1413 (VOID)FatAcquireExclusiveVcb( (IRPCONTEXT), (VCB) ); \
1414 while ( (__FFFFFcb = FatGetNextFcbBottomUp((IRPCONTEXT), __FFFFFcb, (VCB)->RootDcb)) != NULL) { \
1415 (VOID)FatAcquireExclusiveFcb((IRPCONTEXT), __FFFFFcb ); \
1416 } \
1417}
1418
1419#define FatReleaseVolume(IRPCONTEXT,VCB) { \
1420 PFCB __FFFFFcb = NULL; \
1421 NT_ASSERT(FlagOn((IRPCONTEXT)->Flags, IRP_CONTEXT_FLAG_WAIT)); \
1422 while ( (__FFFFFcb = FatGetNextFcbBottomUp((IRPCONTEXT), __FFFFFcb, (VCB)->RootDcb)) != NULL) { \
1423 (VOID)ExReleaseResourceLite( __FFFFFcb->Header.Resource ); \
1424 } \
1425 FatReleaseVcb((IRPCONTEXT), (VCB)); \
1426}
1427
1428//
1429// Macro to enable easy tracking of Vcb state transitions.
1430//
1431
1432#ifdef FASTFATDBG
1433#define FatSetVcbCondition( V, X) { \
1434 DebugTrace(0,DEBUG_TRACE_VERFYSUP,"%d -> ",(V)->VcbCondition); \
1435 DebugTrace(0,DEBUG_TRACE_VERFYSUP,"%x\n",(X)); \
1436 (V)->VcbCondition = (X); \
1437 }
1438#else
1439#define FatSetVcbCondition( V, X) (V)->VcbCondition = (X)
1440#endif
1441
1442//
1443// These macros can be used to determine what kind of FAT we have for an
1444// initialized Vcb. It is somewhat more elegant to use these (visually).
1445//
1446
1447#define FatIsFat32(VCB) ((BOOLEAN)((VCB)->AllocationSupport.FatIndexBitSize == 32))
1448#define FatIsFat16(VCB) ((BOOLEAN)((VCB)->AllocationSupport.FatIndexBitSize == 16))
1449#define FatIsFat12(VCB) ((BOOLEAN)((VCB)->AllocationSupport.FatIndexBitSize == 12))
1450
1451
1452_Requires_lock_held_(_Global_critical_region_)
1455FatAcquireExclusiveVcb_Real (
1456 IN PIRP_CONTEXT IrpContext,
1457 IN PVCB Vcb,
1459 );
1460
1461#define FatAcquireExclusiveVcb( IC, V) FatAcquireExclusiveVcb_Real( IC, V, FALSE)
1462#define FatAcquireExclusiveVcbNoOpCheck( IC, V) FatAcquireExclusiveVcb_Real( IC, V, TRUE)
1463
1464_Requires_lock_held_(_Global_critical_region_)
1467FatAcquireSharedVcb (
1468 IN PIRP_CONTEXT IrpContext,
1469 IN PVCB Vcb
1470 );
1471
1472_Requires_lock_held_(_Global_critical_region_)
1475FatAcquireExclusiveFcb (
1476 IN PIRP_CONTEXT IrpContext,
1477 IN PFCB Fcb
1478 );
1479
1480_Requires_lock_held_(_Global_critical_region_)
1483FatAcquireSharedFcb (
1484 IN PIRP_CONTEXT IrpContext,
1485 IN PFCB Fcb
1486 );
1487
1488_Requires_lock_held_(_Global_critical_region_)
1492 IN PIRP_CONTEXT IrpContext,
1493 IN PFCB Fcb
1494 );
1495
1496#define FatVcbAcquiredExclusive(IRPCONTEXT,VCB) ( \
1497 ExIsResourceAcquiredExclusiveLite(&(VCB)->Resource) || \
1498 ExIsResourceAcquiredExclusiveLite(&FatData.Resource) \
1499)
1500
1501#define FatFcbAcquiredShared(IRPCONTEXT,FCB) ( \
1502 ExIsResourceAcquiredSharedLite((FCB)->Header.Resource) \
1503)
1504
1505#define FatFcbAcquiredExclusive(IRPCONTEXT,FCB) ( \
1506 ExIsResourceAcquiredExclusiveLite((FCB)->Header.Resource) \
1507)
1508
1509#define FatAcquireDirectoryFileMutex(VCB) { \
1510 NT_ASSERT(KeAreApcsDisabled()); \
1511 ExAcquireFastMutexUnsafe(&(VCB)->DirectoryFileCreationMutex); \
1512}
1513
1514#define FatReleaseDirectoryFileMutex(VCB) { \
1515 NT_ASSERT(KeAreApcsDisabled()); \
1516 ExReleaseFastMutexUnsafe(&(VCB)->DirectoryFileCreationMutex); \
1517}
1518
1519//
1520// The following are cache manager call backs
1521
1522BOOLEAN
1524 IN PVOID Vcb,
1526 );
1527
1528VOID
1530 IN PVOID Vcb
1531 );
1532
1533_Requires_lock_held_(_Global_critical_region_)
1534BOOLEAN
1535NTAPI
1536FatAcquireFcbForLazyWrite (
1537 IN PVOID Null,
1539 );
1540
1541_Requires_lock_held_(_Global_critical_region_)
1542VOID
1543NTAPI
1544FatReleaseFcbFromLazyWrite (
1545 IN PVOID Null
1546 );
1547
1548_Requires_lock_held_(_Global_critical_region_)
1549BOOLEAN
1550NTAPI
1551FatAcquireFcbForReadAhead (
1552 IN PVOID Null,
1554 );
1555
1556_Requires_lock_held_(_Global_critical_region_)
1557VOID
1558NTAPI
1559FatReleaseFcbFromReadAhead (
1560 IN PVOID Null
1561 );
1562
1563_Function_class_(FAST_IO_ACQUIRE_FOR_CCFLUSH)
1564_Requires_lock_held_(_Global_critical_region_)
1566NTAPI
1567FatAcquireForCcFlush (
1570 );
1571
1572_Function_class_(FAST_IO_RELEASE_FOR_CCFLUSH)
1573_Requires_lock_held_(_Global_critical_region_)
1575NTAPI
1576FatReleaseForCcFlush (
1579 );
1580
1581BOOLEAN
1582NTAPI
1584 IN PVOID Fcb,
1586 );
1587
1588VOID
1589NTAPI
1591 IN PVOID Fcb
1592 );
1593
1594_Requires_lock_held_(_Global_critical_region_)
1596NTAPI
1597FatFilterCallbackAcquireForCreateSection (
1600 );
1601
1602//
1603// VOID
1604// FatConvertToSharedFcb (
1605// IN PIRP_CONTEXT IrpContext,
1606// IN PFCB Fcb
1607// );
1608//
1609
1610#define FatConvertToSharedFcb(IRPCONTEXT,Fcb) { \
1611 ExConvertExclusiveToSharedLite( (Fcb)->Header.Resource ); \
1612 }
1613
1614//
1615// VOID
1616// FatReleaseGlobal (
1617// IN PIRP_CONTEXT IrpContext
1618// );
1619//
1620// VOID
1621// FatReleaseVcb (
1622// IN PIRP_CONTEXT IrpContext,
1623// IN PVCB Vcb
1624// );
1625//
1626// VOID
1627// FatReleaseFcb (
1628// IN PIRP_CONTEXT IrpContext,
1629// IN PVCB Vcb
1630// );
1631//
1632
1633#define FatDeleteResource(RESRC) { \
1634 ExDeleteResourceLite( (RESRC) ); \
1635}
1636
1637#define FatReleaseGlobal(IRPCONTEXT) { \
1638 ExReleaseResourceLite( &(FatData.Resource) ); \
1639 }
1640
1641#define FatReleaseVcb(IRPCONTEXT,Vcb) { \
1642 ExReleaseResourceLite( &((Vcb)->Resource) ); \
1643 }
1644
1645#define FatReleaseFcb(IRPCONTEXT,Fcb) { \
1646 ExReleaseResourceLite( (Fcb)->Header.Resource ); \
1647 }
1648
1649//
1650// The following macro is used to retrieve the oplock structure within
1651// the Fcb. This structure was moved to the advanced Fcb header
1652// in Win8.
1653//
1654
1655#if (NTDDI_VERSION >= NTDDI_WIN8)
1656
1657#define FatGetFcbOplock(F) &(F)->Header.Oplock
1658
1659#else
1660
1661#define FatGetFcbOplock(F) &(F)->Specific.Fcb.Oplock
1662
1663#endif
1664
1665
1666//
1667// In-memory structure support routine, implemented in StrucSup.c
1668//
1669
1670_Requires_lock_held_(_Global_critical_region_)
1671VOID
1672FatInitializeVcb (
1673 IN PIRP_CONTEXT IrpContext,
1674 IN OUT PVCB Vcb,
1678 );
1679
1680VOID
1682 IN PIRP_CONTEXT IrpContext,
1683 IN PVCB Vcb
1684 );
1685
1686VOID
1688 IN PIRP_CONTEXT IrpContext,
1689 IN PVCB Vcb
1690 );
1691
1692_Requires_lock_held_(_Global_critical_region_)
1693VOID
1694FatCreateRootDcb (
1695 IN PIRP_CONTEXT IrpContext,
1696 IN PVCB Vcb
1697 );
1698
1699PFCB
1701 IN PIRP_CONTEXT IrpContext,
1702 IN PVCB Vcb,
1704 IN ULONG LfnOffsetWithinDirectory,
1705 IN ULONG DirentOffsetWithinDirectory,
1708 IN PUNICODE_STRING OrigLfn OPTIONAL,
1709 IN BOOLEAN IsPagingFile,
1710 IN BOOLEAN SingleResource
1711 );
1712
1713PDCB
1715 IN PIRP_CONTEXT IrpContext,
1716 IN PVCB Vcb,
1718 IN ULONG LfnOffsetWithinDirectory,
1719 IN ULONG DirentOffsetWithinDirectory,
1722 );
1723
1724VOID
1726 IN PIRP_CONTEXT IrpContext,
1727 IN PFCB *Fcb
1728 );
1729
1730PCCB
1732 IN PIRP_CONTEXT IrpContext
1733 );
1734
1735VOID
1737 IN PCCB Ccb
1738 );
1739
1740VOID
1742 IN PIRP_CONTEXT IrpContext,
1743 IN PCCB *Ccb
1744 );
1745
1748 IN PIRP Irp,
1750 );
1751
1752VOID
1754 IN PIRP_CONTEXT IrpContext
1755 );
1756
1757#ifdef FASTFATDBG
1758#define FatDeleteIrpContext(IRPCONTEXT) { \
1759 FatDeleteIrpContext_Real((IRPCONTEXT)); \
1760 (IRPCONTEXT) = NULL; \
1761}
1762#else
1763#define FatDeleteIrpContext(IRPCONTEXT) { \
1764 FatDeleteIrpContext_Real((IRPCONTEXT)); \
1765}
1766#endif // FASTFAT_DBG
1767
1768PFCB
1770 IN PIRP_CONTEXT IrpContext,
1771 IN PFCB Fcb,
1772 IN PFCB TerminationFcb
1773 );
1774
1775PFCB
1777 IN PIRP_CONTEXT IrpContext,
1778 IN PFCB Fcb,
1779 IN PFCB TerminationFcb
1780 );
1781
1782//
1783// These two macros just make the code a bit cleaner.
1784//
1785
1786#define FatGetFirstChild(DIR) ((PFCB)( \
1787 IsListEmpty(&(DIR)->Specific.Dcb.ParentDcbQueue) ? NULL : \
1788 CONTAINING_RECORD((DIR)->Specific.Dcb.ParentDcbQueue.Flink, \
1789 DCB, \
1790 ParentDcbLinks.Flink)))
1791
1792#define FatGetNextSibling(FILE) ((PFCB)( \
1793 &(FILE)->ParentDcb->Specific.Dcb.ParentDcbQueue.Flink == \
1794 (PVOID)(FILE)->ParentDcbLinks.Flink ? NULL : \
1795 CONTAINING_RECORD((FILE)->ParentDcbLinks.Flink, \
1796 FCB, \
1797 ParentDcbLinks.Flink)))
1798
1799_Requires_lock_held_(_Global_critical_region_)
1800BOOLEAN
1801FatCheckForDismount (
1802 IN PIRP_CONTEXT IrpContext,
1803 PVCB Vcb,
1805 );
1806
1807VOID
1809 IN PIRP_CONTEXT IrpContext,
1810 PFCB Fcb,
1813 );
1814
1815_Requires_lock_held_(_Global_critical_region_)
1816VOID
1817FatCheckFreeDirentBitmap (
1818 IN PIRP_CONTEXT IrpContext,
1819 IN PDCB Dcb
1820 );
1821
1822ULONG
1824 IN PIRP_CONTEXT IrpContext,
1825 IN PVCB Vcb
1826 );
1827
1828VOID
1830 IN PVCB Vcb
1831 );
1832
1835 IN PVCB Vcb
1836 );
1837
1838//
1839// BOOLEAN
1840// FatIsRawDevice (
1841// IN PIRP_CONTEXT IrpContext,
1842// IN NTSTATUS Status
1843// );
1844//
1845
1846#define FatIsRawDevice(IC,S) ( \
1847 ((S) == STATUS_DEVICE_NOT_READY) || \
1848 ((S) == STATUS_NO_MEDIA_IN_DEVICE) \
1849)
1850
1851
1852//
1853// Routines to support managing file names Fcbs and Dcbs.
1854// Implemented in SplaySup.c
1855//
1856
1857VOID
1859 IN PIRP_CONTEXT IrpContext,
1862 );
1863
1864VOID
1866 IN PIRP_CONTEXT IrpContext,
1867 IN PFCB Fcb
1868 );
1869
1870PFCB
1871FatFindFcb (
1872 IN PIRP_CONTEXT IrpContext,
1874 IN PSTRING Name,
1875 OUT PBOOLEAN FileNameDos OPTIONAL
1876 );
1877
1878BOOLEAN
1880 IN PIRP_CONTEXT IrpContext,
1881 IN PVCB Vcb
1882 );
1883
1884typedef enum _COMPARISON {
1887 IsEqual
1889
1892 IN PSTRING NameA,
1893 IN PSTRING NameB
1894 );
1895
1896//
1897// Do a macro here to check for a common case.
1898//
1899
1900#define CompareNames(NAMEA,NAMEB) ( \
1901 *(PUCHAR)(NAMEA)->Buffer != *(PUCHAR)(NAMEB)->Buffer ? \
1902 *(PUCHAR)(NAMEA)->Buffer < *(PUCHAR)(NAMEB)->Buffer ? \
1903 IsLessThan : IsGreaterThan : \
1904 FatCompareNames((PSTRING)(NAMEA), (PSTRING)(NAMEB)) \
1905)
1906
1907//
1908// Time conversion support routines, implemented in TimeSup.c
1909//
1910
1911_Success_(return != FALSE)
1912BOOLEAN
1913FatNtTimeToFatTime (
1914 _In_ PIRP_CONTEXT IrpContext,
1919 );
1920
1923 _In_ PIRP_CONTEXT IrpContext,
1925 _In_ UCHAR TenMilliSeconds
1926 );
1927
1930 _In_ PIRP_CONTEXT IrpContext,
1931 _In_ FAT_DATE FatDate
1932 );
1933
1936 _In_ PIRP_CONTEXT IrpContext
1937 );
1938
1939
1940//
1941// Low level verification routines, implemented in VerfySup.c
1942//
1943// The first routine is called to help process a verify IRP. Its job is
1944// to walk every Fcb/Dcb and mark them as need to be verified.
1945//
1946// The other routines are used by every dispatch routine to verify that
1947// an Vcb/Fcb/Dcb is still good. The routine walks as much of the opened
1948// file/directory tree as necessary to make sure that the path is still valid.
1949// The function result indicates if the procedure needed to block for I/O.
1950// If the structure is bad the procedure raise the error condition
1951// STATUS_FILE_INVALID, otherwise they simply return to their caller
1952//
1953
1954typedef enum _FAT_VOLUME_STATE {
1959
1960VOID
1962 IN PIRP_CONTEXT IrpContext,
1963 IN PFCB Fcb,
1964 IN FCB_CONDITION FcbCondition,
1965 IN BOOLEAN Recursive
1966 );
1967
1968VOID
1970 IN PIRP_CONTEXT IrpContext,
1971 IN PVCB Vcb
1972 );
1973
1974_Requires_lock_held_(_Global_critical_region_)
1975VOID
1976FatVerifyFcb (
1977 IN PIRP_CONTEXT IrpContext,
1978 IN PFCB Fcb
1979 );
1980
1981
1982KDEFERRED_ROUTINE FatCleanVolumeDpc;
1983
1984VOID
1985NTAPI
1987 _In_ PKDPC Dpc,
1991 );
1992
1993_Requires_lock_held_(_Global_critical_region_)
1994VOID
1995FatMarkVolume (
1996 IN PIRP_CONTEXT IrpContext,
1997 IN PVCB Vcb,
1999 );
2000
2002
2003VOID
2004NTAPI
2007 );
2008
2009VOID
2011 IN PIRP_CONTEXT IrpContext,
2012 IN PVCB Vcb
2013 );
2014
2015VOID
2017 IN PIRP_CONTEXT IrpContext,
2018 IN PVCB Vcb
2019 );
2020
2021VOID
2023 IN PIRP_CONTEXT IrpContext
2024 );
2025
2026_Requires_lock_held_(_Global_critical_region_)
2028FatPerformVerify (
2029 _In_ PIRP_CONTEXT IrpContext,
2030 _In_ PIRP Irp,
2032 );
2033
2034
2035//
2036// Work queue routines for posting and retrieving an Irp, implemented in
2037// workque.c
2038//
2039
2040VOID
2041NTAPI
2044 IN PIRP Irp
2045 );
2046
2047VOID
2048NTAPI
2051 IN PIRP Irp
2052 );
2053
2054VOID
2055#ifdef __REACTOS__
2056NTAPI
2057#endif
2059 IN PIRP_CONTEXT IrpContext,
2060 IN PIRP Irp
2061 );
2062
2065 IN PIRP_CONTEXT IrpContext,
2066 IN PIRP Irp
2067 );
2068
2069//
2070// Miscellaneous support routines
2071//
2072
2073//
2074// ULONG
2075// PtrOffset (
2076// IN PVOID BasePtr,
2077// IN PVOID OffsetPtr
2078// );
2079//
2080
2081#define PtrOffset(BASE,OFFSET) ((ULONG)((ULONG_PTR)(OFFSET) - (ULONG_PTR)(BASE)))
2082
2083//
2084// This macro takes a pointer (or ulong) and returns its rounded up word
2085// value
2086//
2087
2088#define WordAlign(Ptr) ( \
2089 ((((ULONG)(Ptr)) + 1) & 0xfffffffe) \
2090 )
2091
2092//
2093// This macro takes a pointer (or ulong) and returns its rounded up longword
2094// value
2095//
2096
2097#define LongAlign(Ptr) ( \
2098 ((((ULONG)(Ptr)) + 3) & 0xfffffffc) \
2099 )
2100
2101//
2102// This macro takes a pointer (or ulong) and returns its rounded up quadword
2103// value
2104//
2105
2106#define QuadAlign(Ptr) ( \
2107 ((((ULONG)(Ptr)) + 7) & 0xfffffff8) \
2108 )
2109
2110//
2111// The following types and macros are used to help unpack the packed and
2112// misaligned fields found in the Bios parameter block
2113//
2114
2115typedef union _UCHAR1 {
2116 UCHAR Uchar[1];
2119
2120typedef union _UCHAR2 {
2121 UCHAR Uchar[2];
2124
2125typedef union _UCHAR4 {
2126 UCHAR Uchar[4];
2129
2130//
2131// This macro copies an unaligned src byte to an aligned dst byte
2132//
2133
2134#define CopyUchar1(Dst,Src) { \
2135 *((UCHAR1 *)(Dst)) = *((UNALIGNED UCHAR1 *)(Src)); \
2136 }
2137
2138//
2139// This macro copies an unaligned src word to an aligned dst word
2140//
2141
2142#define CopyUchar2(Dst,Src) { \
2143 *((UCHAR2 *)(Dst)) = *((UNALIGNED UCHAR2 *)(Src)); \
2144 }
2145
2146//
2147// This macro copies an unaligned src longword to an aligned dsr longword
2148//
2149
2150#define CopyUchar4(Dst,Src) { \
2151 *((UCHAR4 *)(Dst)) = *((UNALIGNED UCHAR4 *)(Src)); \
2152 }
2153
2154#define CopyU4char(Dst,Src) { \
2155 *((UNALIGNED UCHAR4 *)(Dst)) = *((UCHAR4 *)(Src)); \
2156 }
2157
2158//
2159// VOID
2160// FatNotifyReportChange (
2161// IN PIRP_CONTEXT IrpContext,
2162// IN PVCB Vcb,
2163// IN PFCB Fcb,
2164// IN ULONG Filter,
2165// IN ULONG Action
2166// );
2167//
2168
2169#define FatNotifyReportChange(I,V,F,FL,A) { \
2170 if ((F)->FullFileName.Buffer == NULL) { \
2171 FatSetFullFileNameInFcb((I),(F)); \
2172 } \
2173 NT_ASSERT( (F)->FullFileName.Length != 0 ); \
2174 NT_ASSERT( (F)->FinalNameLength != 0 ); \
2175 NT_ASSERT( (F)->FullFileName.Length > (F)->FinalNameLength ); \
2176 NT_ASSERT( (F)->FullFileName.Buffer[((F)->FullFileName.Length - (F)->FinalNameLength)/sizeof(WCHAR) - 1] == L'\\' ); \
2177 FsRtlNotifyFullReportChange( (V)->NotifySync, \
2178 &(V)->DirNotifyList, \
2179 (PSTRING)&(F)->FullFileName, \
2180 (USHORT) ((F)->FullFileName.Length - \
2181 (F)->FinalNameLength), \
2182 (PSTRING)NULL, \
2183 (PSTRING)NULL, \
2184 (ULONG)FL, \
2185 (ULONG)A, \
2186 (PVOID)NULL ); \
2187}
2188
2189
2190//
2191// The FSD Level dispatch routines. These routines are called by the
2192// I/O system via the dispatch table in the Driver Object.
2193//
2194// They each accept as input a pointer to a device object (actually most
2195// expect a volume device object, with the exception of the file system
2196// control function which can also take a file system device object), and
2197// a pointer to the IRP. They either perform the function at the FSD level
2198// or post the request to the FSP work queue for FSP level processing.
2199//
2200
2204NTAPI
2205FatFsdCleanup ( // implemented in Cleanup.c
2206 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2208 );
2209
2213NTAPI
2214FatFsdClose ( // implemented in Close.c
2215 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2217 );
2218
2222NTAPI
2223FatFsdCreate ( // implemented in Create.c
2224 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2226 );
2227
2228
2232NTAPI
2233FatFsdDeviceControl ( // implemented in DevCtrl.c
2234 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2236 );
2237
2241NTAPI
2242FatFsdDirectoryControl ( // implemented in DirCtrl.c
2243 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2245 );
2246
2250NTAPI
2251FatFsdQueryEa ( // implemented in Ea.c
2252 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2254 );
2255
2259NTAPI
2260FatFsdSetEa ( // implemented in Ea.c
2261 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2263 );
2264
2268NTAPI
2269FatFsdQueryInformation ( // implemented in FileInfo.c
2270 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2272 );
2273
2277NTAPI
2278FatFsdSetInformation ( // implemented in FileInfo.c
2279 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2281 );
2282
2286NTAPI
2287FatFsdFlushBuffers ( // implemented in Flush.c
2288 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2290 );
2291
2295NTAPI
2296FatFsdFileSystemControl ( // implemented in FsCtrl.c
2297 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2299 );
2300
2304NTAPI
2305FatFsdLockControl ( // implemented in LockCtrl.c
2306 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2308 );
2309
2313NTAPI
2314FatFsdPnp ( // implemented in Pnp.c
2315 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2317 );
2318
2322NTAPI
2323FatFsdRead ( // implemented in Read.c
2324 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2326 );
2327
2331NTAPI
2332FatFsdShutdown ( // implemented in Shutdown.c
2333 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2335 );
2336
2340NTAPI
2341FatFsdQueryVolumeInformation ( // implemented in VolInfo.c
2342 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2344 );
2345
2349NTAPI
2350FatFsdSetVolumeInformation ( // implemented in VolInfo.c
2351 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2353 );
2354
2358NTAPI
2359FatFsdWrite ( // implemented in Write.c
2360 _In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject,
2362 );
2363
2364//
2365// The following macro is used to determine if an FSD thread can block
2366// for I/O or wait for a resource. It returns TRUE if the thread can
2367// block and FALSE otherwise. This attribute can then be used to call
2368// the FSD & FSP common work routine with the proper wait value.
2369//
2370
2371#define CanFsdWait(IRP) IoIsOperationSynchronous(Irp)
2372
2373
2374//
2375// The FSP level dispatch/main routine. This is the routine that takes
2376// IRP's off of the work queue and calls the appropriate FSP level
2377// work routine.
2378//
2379
2380
2381WORKER_THREAD_ROUTINE FatFspDispatch;
2382
2383VOID
2384NTAPI
2385FatFspDispatch ( // implemented in FspDisp.c
2387 );
2388
2389//
2390// The following routines are the FSP work routines that are called
2391// by the preceding FatFspDispath routine. Each takes as input a pointer
2392// to the IRP, perform the function, and return a pointer to the volume
2393// device object that they just finished servicing (if any). The return
2394// pointer is then used by the main Fsp dispatch routine to check for
2395// additional IRPs in the volume's overflow queue.
2396//
2397// Each of the following routines is also responsible for completing the IRP.
2398// We moved this responsibility from the main loop to the individual routines
2399// to allow them the ability to complete the IRP and continue post processing
2400// actions.
2401//
2402
2403_Requires_lock_held_(_Global_critical_region_)
2405FatCommonCleanup ( // implemented in Cleanup.c
2406 IN PIRP_CONTEXT IrpContext,
2407 IN PIRP Irp
2408 );
2409
2410_Requires_lock_held_(_Global_critical_region_)
2412FatCommonClose ( // implemented in Close.c
2413 IN PVCB Vcb,
2414 IN PFCB Fcb,
2415 IN PCCB Ccb,
2417 IN BOOLEAN Wait,
2419 OUT PBOOLEAN VcbDeleted OPTIONAL
2420 );
2421
2422_Requires_lock_held_(_Global_critical_region_)
2423VOID
2424FatFspClose ( // implemented in Close.c
2426 );
2427
2428_Requires_lock_held_(_Global_critical_region_)
2430FatCommonCreate ( // implemented in Create.c
2431 _Inout_ PIRP_CONTEXT IrpContext,
2433 );
2434
2435#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
2436
2437_Requires_lock_held_(_Global_critical_region_)
2439FatCommonCreateOnNewStack ( // implemented in Create.c
2440 _Inout_ PIRP_CONTEXT IrpContext,
2442 );
2443
2444_Requires_lock_held_(_Global_critical_region_)
2445VOID
2446FatCommonCreateCallout ( // implemented in Create.c
2447 _In_ PFAT_CALLOUT_PARAMETERS CalloutParameters
2448 );
2449
2450#endif
2451
2452_Requires_lock_held_(_Global_critical_region_)
2454FatCommonDirectoryControl ( // implemented in DirCtrl.c
2455 IN PIRP_CONTEXT IrpContext,
2456 IN PIRP Irp
2457 );
2458
2459_Requires_lock_held_(_Global_critical_region_)
2461FatCommonDeviceControl ( // implemented in DevCtrl.c
2462 IN PIRP_CONTEXT IrpContext,
2463 IN PIRP Irp
2464 );
2465
2467FatCommonQueryEa ( // implemented in Ea.c
2468 IN PIRP_CONTEXT IrpContext,
2469 IN PIRP Irp
2470 );
2471
2473FatCommonSetEa ( // implemented in Ea.c
2474 IN PIRP_CONTEXT IrpContext,
2475 IN PIRP Irp
2476 );
2477
2478_Requires_lock_held_(_Global_critical_region_)
2480FatCommonQueryInformation ( // implemented in FileInfo.c
2481 IN PIRP_CONTEXT IrpContext,
2482 IN PIRP Irp
2483 );
2484
2485_Requires_lock_held_(_Global_critical_region_)
2487FatCommonSetInformation ( // implemented in FileInfo.c
2488 IN PIRP_CONTEXT IrpContext,
2489 IN PIRP Irp
2490 );
2491
2492_Requires_lock_held_(_Global_critical_region_)
2494FatCommonFlushBuffers ( // implemented in Flush.c
2495 IN PIRP_CONTEXT IrpContext,
2496 IN PIRP Irp
2497 );
2498
2499_Requires_lock_held_(_Global_critical_region_)
2501FatCommonFileSystemControl ( // implemented in FsCtrl.c
2502 IN PIRP_CONTEXT IrpContext,
2503 IN PIRP Irp
2504 );
2505
2506_Requires_lock_held_(_Global_critical_region_)
2508FatCommonLockControl ( // implemented in LockCtrl.c
2509 IN PIRP_CONTEXT IrpContext,
2510 IN PIRP Irp
2511 );
2512
2513_Requires_lock_held_(_Global_critical_region_)
2515FatCommonPnp ( // implemented in Pnp.c
2516 IN PIRP_CONTEXT IrpContext,
2517 IN PIRP Irp
2518 );
2519
2520_Requires_lock_held_(_Global_critical_region_)
2522FatCommonRead ( // implemented in Read.c
2523 IN PIRP_CONTEXT IrpContext,
2524 IN PIRP Irp
2525 );
2526
2527_Requires_lock_held_(_Global_critical_region_)
2529FatCommonShutdown ( // implemented in Shutdown.c
2530 IN PIRP_CONTEXT IrpContext,
2531 IN PIRP Irp
2532 );
2533
2534_Requires_lock_held_(_Global_critical_region_)
2536FatCommonQueryVolumeInfo ( // implemented in VolInfo.c
2537 IN PIRP_CONTEXT IrpContext,
2538 IN PIRP Irp
2539 );
2540
2541_Requires_lock_held_(_Global_critical_region_)
2543FatCommonSetVolumeInfo ( // implemented in VolInfo.c
2544 IN PIRP_CONTEXT IrpContext,
2545 IN PIRP Irp
2546 );
2547
2548_Requires_lock_held_(_Global_critical_region_)
2550FatCommonWrite ( // implemented in Write.c
2551 IN PIRP_CONTEXT IrpContext,
2552 IN PIRP Irp
2553 );
2554
2555//
2556// The following is implemented in Flush.c, and does what is says.
2557//
2558
2559_Requires_lock_held_(_Global_critical_region_)
2561FatFlushFile (
2562 IN PIRP_CONTEXT IrpContext,
2563 IN PFCB Fcb,
2565 );
2566
2567_Requires_lock_held_(_Global_critical_region_)
2569FatFlushDirectory (
2570 IN PIRP_CONTEXT IrpContext,
2571 IN PDCB Dcb,
2573 );
2574
2577 IN PIRP_CONTEXT IrpContext,
2578 IN PVCB Vcb
2579 );
2580
2581_Requires_lock_held_(_Global_critical_region_)
2583FatFlushVolume (
2584 IN PIRP_CONTEXT IrpContext,
2585 IN PVCB Vcb,
2587 );
2588
2591 IN PIRP_CONTEXT IrpContext,
2592 IN PIRP Irp,
2594 );
2595
2596VOID
2598 IN PIRP_CONTEXT IrpContext,
2599 IN PVCB Vcb,
2600 IN ULONG Cluster,
2601 IN ULONG Count
2602);
2603
2604VOID
2606 IN PIRP_CONTEXT IrpContext,
2607 IN PFCB Fcb
2608);
2609
2610
2611
2612//
2613// The following procedure is used by the FSP and FSD routines to complete
2614// an IRP.
2615//
2616// Note that this macro allows either the Irp or the IrpContext to be
2617// null, however the only legal order to do this in is:
2618//
2619// FatCompleteRequest( NULL, Irp, Status ); // completes Irp & preserves context
2620// ...
2621// FatCompleteRequest( IrpContext, NULL, DontCare ); // deallocates context
2622//
2623// This would typically be done in order to pass a "naked" IrpContext off to
2624// the Fsp for post processing, such as read ahead.
2625//
2626
2627VOID
2629 IN PIRP_CONTEXT IrpContext,
2630 IN PIRP Irp,
2632 );
2633
2634#define FatCompleteRequest(IRPCONTEXT,IRP,STATUS) { \
2635 FatCompleteRequest_Real(IRPCONTEXT,IRP,STATUS); \
2636}
2637
2638BOOLEAN
2640 IN PIRP Irp
2641 );
2642
2643//
2644// The Following routine makes a popup
2645//
2646
2647_Requires_lock_held_(_Global_critical_region_)
2648VOID
2649FatPopUpFileCorrupt (
2650 IN PIRP_CONTEXT IrpContext,
2651 IN PFCB Fcb
2652 );
2653
2654//
2655// Here are the callbacks used by the I/O system for checking for fast I/O or
2656// doing a fast query info call, or doing fast lock calls.
2657//
2658_Function_class_(FAST_IO_CHECK_IF_POSSIBLE)
2659BOOLEAN
2660NTAPI
2661FatFastIoCheckIfPossible (
2664 IN ULONG Length,
2665 IN BOOLEAN Wait,
2670 );
2671
2672_Function_class_(FAST_IO_QUERY_BASIC_INFO)
2673BOOLEAN
2674NTAPI
2675FatFastQueryBasicInfo (
2677 IN BOOLEAN Wait,
2681 );
2682
2683_Function_class_(FAST_IO_QUERY_STANDARD_INFO)
2684BOOLEAN
2685NTAPI
2686FatFastQueryStdInfo (
2688 IN BOOLEAN Wait,
2692 );
2693
2694_Function_class_(FAST_IO_QUERY_NETWORK_OPEN_INFO)
2695BOOLEAN
2696NTAPI
2697FatFastQueryNetworkOpenInfo (
2699 IN BOOLEAN Wait,
2703 );
2704
2705_Function_class_(FAST_IO_LOCK)
2706BOOLEAN
2707NTAPI
2708FatFastLock (
2718 );
2719
2720_Function_class_(FAST_IO_UNLOCK_SINGLE)
2721BOOLEAN
2722NTAPI
2723FatFastUnlockSingle (
2728 ULONG Key,
2731 );
2732
2733_Function_class_(FAST_IO_UNLOCK_ALL)
2734BOOLEAN
2735NTAPI
2736FatFastUnlockAll (
2741 );
2742
2743_Function_class_(FAST_IO_UNLOCK_ALL_BY_KEY)
2744BOOLEAN
2745NTAPI
2746FatFastUnlockAllByKey (
2749 ULONG Key,
2752 );
2753
2754
2755VOID
2757 IN PIRP_CONTEXT IrpContext,
2758 IN PVCB Vcb,
2759 IN ULONG StartIndex OPTIONAL,
2760 IN ULONG EndIndex OPTIONAL,
2761 IN BOOLEAN SetupWindows,
2762 IN PFAT_WINDOW SwitchToWindow OPTIONAL,
2763 IN PULONG BitMapBuffer OPTIONAL
2764 );
2765
2766BOOLEAN
2768 IN PIRP_CONTEXT IrpContext,
2770 );
2771
2772//
2773// The following macro is used to determine is a file has been deleted.
2774//
2775// BOOLEAN
2776// IsFileDeleted (
2777// IN PIRP_CONTEXT IrpContext,
2778// IN PFCB Fcb
2779// );
2780//
2781
2782#define IsFileDeleted(IRPCONTEXT,FCB) \
2783 (FlagOn((FCB)->FcbState, FCB_STATE_DELETE_ON_CLOSE) && \
2784 ((FCB)->UncleanCount == 0))
2785
2786//
2787// The following macro is used by the dispatch routines to determine if
2788// an operation is to be done with or without Write Through.
2789//
2790// BOOLEAN
2791// IsFileWriteThrough (
2792// IN PFILE_OBJECT FileObject,
2793// IN PVCB Vcb
2794// );
2795//
2796
2797#define IsFileWriteThrough(FO,VCB) ( \
2798 BooleanFlagOn((FO)->Flags, FO_WRITE_THROUGH) \
2799)
2800
2801//
2802// The following macro is used to set the is fast i/o possible field in
2803// the common part of the nonpaged fcb. It checks that this is actually
2804// an FCB (as opposed to a DCB) so that directory oplock code works properly.
2805//
2806//
2807// BOOLEAN
2808// FatIsFastIoPossible (
2809// IN PFCB Fcb
2810// );
2811//
2812
2813
2814#define FatIsFastIoPossible(FCB) ((BOOLEAN) \
2815 ((((FCB)->FcbCondition != FcbGood) || \
2816 (NodeType( (FCB) ) != FAT_NTC_FCB) || \
2817 !FsRtlOplockIsFastIoPossible( FatGetFcbOplock(FCB) )) ? \
2818 FastIoIsNotPossible \
2819 : \
2820 (!FsRtlAreThereCurrentFileLocks( &(FCB)->Specific.Fcb.FileLock ) && \
2821 ((FCB)->NonPaged->OutstandingAsyncWrites == 0) && \
2822 !FlagOn( (FCB)->Vcb->VcbState, VCB_STATE_FLAG_WRITE_PROTECTED ) ? \
2823 FastIoIsPossible \
2824 : \
2825 FastIoIsQuestionable \
2826 ) \
2827 ) \
2828)
2829
2830
2831#if (NTDDI_VERSION >= NTDDI_WIN8)
2832
2833//
2834// Detect whether this file can have an oplock on it. As of Windows 8 file and
2835// directories can have oplocks.
2836//
2837
2838#define FatIsNodeTypeOplockable(N) ( \
2839 ((N) == FAT_NTC_FCB) || \
2840 ((N) == FAT_NTC_ROOT_DCB) || \
2841 ((N) == FAT_NTC_DCB) \
2842)
2843
2844#else
2845
2846#define FatIsNodeTypeOplockable(N) ( \
2847 ((N) == FAT_NTC_FCB) \
2848)
2849
2850#endif
2851
2852#define FatIsFileOplockable(F) ( \
2853 FatIsNodeTypeOplockable( NodeType( (F) )) \
2854)
2855
2856//
2857// The following macro is used to detemine if the file object is opened
2858// for read only access (i.e., it is not also opened for write access or
2859// delete access).
2860//
2861// BOOLEAN
2862// IsFileObjectReadOnly (
2863// IN PFILE_OBJECT FileObject
2864// );
2865//
2866
2867#define IsFileObjectReadOnly(FO) (!((FO)->WriteAccess | (FO)->DeleteAccess))
2868
2869
2870//
2871// The following two macro are used by the Fsd/Fsp exception handlers to
2872// process an exception. The first macro is the exception filter used in the
2873// Fsd/Fsp to decide if an exception should be handled at this level.
2874// The second macro decides if the exception is to be finished off by
2875// completing the IRP, and cleaning up the Irp Context, or if we should
2876// bugcheck. Exception values such as STATUS_FILE_INVALID (raised by
2877// VerfySup.c) cause us to complete the Irp and cleanup, while exceptions
2878// such as accvio cause us to bugcheck.
2879//
2880// The basic structure for fsd/fsp exception handling is as follows:
2881//
2882// FatFsdXxx(...)
2883// {
2884// try {
2885//
2886// ...
2887//
2888// } except(FatExceptionFilter( IrpContext, GetExceptionCode() )) {
2889//
2890// Status = FatProcessException( IrpContext, Irp, GetExceptionCode() );
2891// }
2892//
2893// Return Status;
2894// }
2895//
2896// To explicitly raise an exception that we expect, such as
2897// STATUS_FILE_INVALID, use the below macro FatRaiseStatus(). To raise a
2898// status from an unknown origin (such as CcFlushCache()), use the macro
2899// FatNormalizeAndRaiseStatus. This will raise the status if it is expected,
2900// or raise STATUS_UNEXPECTED_IO_ERROR if it is not.
2901//
2902// If we are vicariously handling exceptions without using FatProcessException(),
2903// if there is the possibility that we raised that exception, one *must*
2904// reset the IrpContext so a subsequent raise in the course of handling this
2905// request that is *not* explicit, i.e. like a pagein error, does not get
2906// spoofed into believing that the first raise status is the reason the second
2907// occured. This could have really serious consequences.
2908//
2909// It is an excellent idea to always FatResetExceptionState in these cases.
2910//
2911// Note that when using these two macros, the original status is placed in
2912// IrpContext->ExceptionStatus, signaling FatExceptionFilter and
2913// FatProcessException that the status we actually raise is by definition
2914// expected.
2915//
2916
2917ULONG
2919 IN PIRP_CONTEXT IrpContext,
2920 IN PEXCEPTION_POINTERS ExceptionPointer
2921 );
2922
2923#if DBG
2924ULONG
2925FatBugCheckExceptionFilter (
2926 IN PEXCEPTION_POINTERS ExceptionPointer
2927 );
2928#endif
2929
2930_Requires_lock_held_(_Global_critical_region_)
2932FatProcessException (
2933 IN PIRP_CONTEXT IrpContext,
2934 IN PIRP Irp,
2936 );
2937
2938//
2939// VOID
2940// FatRaiseStatus (
2941// IN PRIP_CONTEXT IrpContext,
2942// IN NT_STATUS Status
2943// );
2944//
2945//
2946
2947#if DBG
2948#ifdef _MSC_VER
2949#define DebugBreakOnStatus(S) { \
2950__pragma(warning(push)) \
2951__pragma(warning(disable:4127)) \
2952 if (FatTestRaisedStatus) { \
2953 if ((S) == STATUS_DISK_CORRUPT_ERROR || (S) == STATUS_FILE_CORRUPT_ERROR) { \
2954__pragma(warning(pop)) \
2955 DbgPrint( "FAT: Breaking on interesting raised status (0x%08x)\n", (S) );\
2956 DbgPrint( "FAT: Set FatTestRaisedStatus @ 0x%p to 0 to disable\n", \
2957 &FatTestRaisedStatus ); \
2958 NT_ASSERT(FALSE); \
2959 } \
2960 } \
2961}
2962#else
2963#define DebugBreakOnStatus(S) { \
2964 if (FatTestRaisedStatus) { \
2965 if ((S) == STATUS_DISK_CORRUPT_ERROR || (S) == STATUS_FILE_CORRUPT_ERROR) { \
2966 DbgPrint( "FAT: Breaking on interesting raised status (0x%08x)\n", (S) );\
2967 DbgPrint( "FAT: Set FatTestRaisedStatus @ 0x%p to 0 to disable\n", \
2968 &FatTestRaisedStatus ); \
2969 NT_ASSERT(FALSE); \
2970 } \
2971 } \
2972}
2973#endif
2974#else
2975#define DebugBreakOnStatus(S)
2976#endif
2977
2978#define FatRaiseStatus(IRPCONTEXT,STATUS) { \
2979 (IRPCONTEXT)->ExceptionStatus = (STATUS); \
2980 DebugBreakOnStatus( (STATUS) ) \
2981 ExRaiseStatus( (STATUS) ); \
2982}
2983
2984#define FatResetExceptionState( IRPCONTEXT ) { \
2985 (IRPCONTEXT)->ExceptionStatus = STATUS_SUCCESS; \
2986}
2987
2988//
2989// VOID
2990// FatNormalAndRaiseStatus (
2991// IN PRIP_CONTEXT IrpContext,
2992// IN NT_STATUS Status
2993// );
2994//
2995
2996#define FatNormalizeAndRaiseStatus(IRPCONTEXT,STATUS) { \
2997 (IRPCONTEXT)->ExceptionStatus = (STATUS); \
2998 ExRaiseStatus(FsRtlNormalizeNtstatus((STATUS),STATUS_UNEXPECTED_IO_ERROR)); \
2999}
3000
3001
3002//
3003// The following macros are used to establish the semantics needed
3004// to do a return from within a try-finally clause. As a rule every
3005// try clause must end with a label call try_exit. For example,
3006//
3007// try {
3008// :
3009// :
3010//
3011// try_exit: NOTHING;
3012// } finally {
3013//
3014// :
3015// :
3016// }
3017//
3018// Every return statement executed inside of a try clause should use the
3019// try_return macro. If the compiler fully supports the try-finally construct
3020// then the macro should be
3021//
3022// #define try_return(S) { return(S); }
3023//
3024// If the compiler does not support the try-finally construct then the macro
3025// should be
3026//
3027// #define try_return(S) { S; goto try_exit; }
3028//
3029
3030#define try_return(S) { S; goto try_exit; }
3031#define try_leave(S) { S; _SEH2_LEAVE; }
3032
3033
3036 IN PVCB Vcb,
3038 );
3039
3040
3041//
3042// These routines define the FileId for FAT. Lacking a fixed/uniquifiable
3043// notion, we simply come up with one which is unique in a given snapshot
3044// of the volume. As long as the parent directory is not moved or compacted,
3045// it may even be permanent.
3046//
3047
3048//
3049// The internal information used to identify the fcb/dcb on the
3050// volume is the byte offset of the dirent of the file on disc.
3051// Our root always has fileid 0. FAT32 roots are chains and can
3052// use the LBO of the cluster, 12/16 roots use the lbo in the Vcb.
3053//
3054
3055#define FatGenerateFileIdFromDirentOffset(ParentDcb,DirentOffset) \
3056 ((ParentDcb) ? ((NodeType(ParentDcb) != FAT_NTC_ROOT_DCB || FatIsFat32((ParentDcb)->Vcb)) ? \
3057 FatGetLboFromIndex( (ParentDcb)->Vcb, \
3058 (ParentDcb)->FirstClusterOfFile ) : \
3059 (ParentDcb)->Vcb->AllocationSupport.RootDirectoryLbo) + \
3060 (DirentOffset) \
3061 : \
3062 0)
3063
3064//
3065//
3066
3067#define FatGenerateFileIdFromFcb(Fcb) \
3068 FatGenerateFileIdFromDirentOffset( (Fcb)->ParentDcb, (Fcb)->DirentOffsetWithinDirectory )
3069
3070//
3071// Wrap to handle the ./.. cases appropriately. Note that we commute NULL parent to 0. This would
3072// only occur in an illegal root ".." entry.
3073//
3074
3075#define FATDOT ((ULONG)0x2020202E)
3076#define FATDOTDOT ((ULONG)0x20202E2E)
3077
3078#define FatGenerateFileIdFromDirentAndOffset(Dcb,Dirent,DirentOffset) \
3079 ((*((PULONG)(Dirent)->FileName)) == FATDOT ? FatGenerateFileIdFromFcb(Dcb) : \
3080 ((*((PULONG)(Dirent)->FileName)) == FATDOTDOT ? ((Dcb)->ParentDcb ? \
3081 FatGenerateFileIdFromFcb((Dcb)->ParentDcb) : \
3082 0) : \
3083 FatGenerateFileIdFromDirentOffset(Dcb,DirentOffset)))
3084
3085
3086//
3087// BOOLEAN
3088// FatDeviceIsFatFsdo(
3089// IN PDEVICE_OBJECT D
3090// );
3091//
3092// Evaluates to TRUE if the supplied device object is one of the file system devices
3093// we created at initialisation.
3094//
3095
3096#define FatDeviceIsFatFsdo( D) (((D) == FatData.DiskFileSystemDeviceObject) || ((D) == FatData.CdromFileSystemDeviceObject))
3097
3098
3099//
3100// BlockAlign(): Aligns P on the next V boundary.
3101// BlockAlignTruncate(): Aligns P on the prev V boundary.
3102//
3103
3104#define BlockAlign(P,V) ((ASSERT( V != 0)), (((P)) + (V-1) & (0-(V))))
3105#define BlockAlignTruncate(P,V) ((P) & (0-(V)))
3106
3107#define IsDirectory(FcbOrDcb) ((NodeType((FcbOrDcb)) == FAT_NTC_DCB) || (NodeType((FcbOrDcb)) == FAT_NTC_ROOT_DCB))
3108
3109#endif // _FATPROCS_
3110
3111
static CC_FILE_SIZES FileSizes
PCWSTR Expression
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID DeleteContext(PWSTR pszName)
Definition: context.c:224
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
PWCHAR Label
Definition: format.c:70
return
Definition: dirsup.c:529
_TYPE_OF_OPEN
Definition: cdprocs.h:571
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
enum _FCB_CONDITION FCB_CONDITION
Definition: bufpool.h:45
Definition: Header.h:9
#define _Requires_lock_held_(lock)
#define _Acquires_exclusive_lock_(lock)
#define _Acquires_shared_lock_(lock)
_In_ PIRP Irp
Definition: csq.h:116
#define __out_opt
Definition: dbghelp.h:65
#define __in
Definition: dbghelp.h:35
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB ParentDcb
Definition: create.c:4141
return Iosb
Definition: create.c:4402
LONGLONG LBO
Definition: fat.h:34
LBO * PLBO
Definition: fat.h:36
VBO * PVBO
Definition: fat.h:39
ULONG32 VBO
Definition: fat.h:38
FAT8DOT3 * PFAT8DOT3
Definition: fat.h:296
VOID FatQuickVerifyVcb(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: verfysup.c:1662
_FAT_VOLUME_STATE
Definition: fatprocs.h:1954
@ VolumeClean
Definition: fatprocs.h:1955
@ VolumeDirty
Definition: fatprocs.h:1956
@ VolumeDirtyWithSurfaceTest
Definition: fatprocs.h:1957
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN ExactMatchRequired
Definition: fatprocs.h:347
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2666
IN PDCB IN ULONG LfnOffset
Definition: fatprocs.h:790
IN PVCB Vcb
Definition: fatprocs.h:344
union _UCHAR2 UCHAR2
IN PVCB IN ULONG EaSetLength
Definition: fatprocs.h:947
VOID FatDeleteFcb(IN PIRP_CONTEXT IrpContext, IN PFCB *Fcb)
Definition: strucsup.c:1952
VOID FatUnicodeRestoreShortNameCase(IN PUNICODE_STRING ShortNameWithCase, IN BOOLEAN LowerCase8, IN BOOLEAN LowerCase3)
Definition: namesup.c:1041
NTSTATUS FatToggleMediaEjectDisable(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN BOOLEAN PreventRemoval)
Definition: deviosup.c:3495
VOID FatCloseEaFile(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN BOOLEAN FlushFirst)
Definition: cachesup.c:1079
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1675
VOID FatInsertName(IN PIRP_CONTEXT IrpContext, IN PRTL_SPLAY_LINKS *RootNode, IN PFILE_NAME_NODE Name)
Definition: splaysup.c:39
IN PDCB IN ULONG IN BOOLEAN RescanDir
Definition: fatprocs.h:702
PFCB FatGetNextFcbTopDown(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb, IN PFCB TerminationFcb)
Definition: strucsup.c:2627
_In_ PLARGE_INTEGER NtTime
Definition: fatprocs.h:1915
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:415
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT * Dirent
Definition: fatprocs.h:730
IN PVCB IN ULONG IN PBCB OUT PDIRENT OUT PUSHORT OUT PEA_RANGE EaSetRange
Definition: fatprocs.h:952
VOID FatUnicodeToUpcaseOem(IN PIRP_CONTEXT IrpContext, IN POEM_STRING OemString, IN PUNICODE_STRING UnicodeString)
Definition: namesup.c:632
VOID FatDeleteCcb(IN PIRP_CONTEXT IrpContext, IN PCCB *Ccb)
Definition: strucsup.c:2254
NTSTATUS FatCommonQueryEa(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
Definition: ea.c:250
VOID FatPinEaRange(IN PIRP_CONTEXT IrpContext, IN PFILE_OBJECT VirtualEaFile, IN PFCB EaFcb, IN OUT PEA_RANGE EaRange, IN ULONG StartingVbo, IN ULONG Length, IN NTSTATUS ErrorStatus)
Definition: easup.c:3512
VOID FatUnpinRepinnedBcbs(IN PIRP_CONTEXT IrpContext)
Definition: cachesup.c:1407
IN PVCB IN VBO StartingVbo
Definition: fatprocs.h:413
IN PDCB IN PUNICODE_STRING Lfn
Definition: fatprocs.h:754
VOID FatInitializeCacheMap(_In_ PFILE_OBJECT FileObject, _In_ PCC_FILE_SIZES FileSizes, _In_ BOOLEAN PinAccess, _In_ PCACHE_MANAGER_CALLBACKS Callbacks, _In_ PVOID LazyWriteContext)
Definition: cachesup.c:62
static INLINE BOOLEAN FatIsNameLongUnicodeValid(PIRP_CONTEXT IrpContext, PUNICODE_STRING Name, BOOLEAN CanContainWildcards, BOOLEAN PathNameOk, BOOLEAN LeadingBackslashOk)
Definition: fatprocs.h:1216
VOID FatDeleteVcb(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: strucsup.c:772
VOID FatMarkEaRangeDirty(IN PIRP_CONTEXT IrpContext, IN PFILE_OBJECT EaFileObject, IN OUT PEA_RANGE EaRange)
Definition: easup.c:3709
NTSTATUS FatUnlockVolumeInternal(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_OBJECT FileObject OPTIONAL)
Definition: fsctrl.c:3601
VOID FatStringTo8dot3(_In_ PIRP_CONTEXT IrpContext, _In_ OEM_STRING InputString, _Out_writes_bytes_(11) PFAT8DOT3 Output8dot3)
Definition: namesup.c:79
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING IN PUNICODE_STRING SuggestedShortName IN OUT BOOLEAN IN OUT BOOLEAN IN OUT BOOLEAN * CreateLfn
Definition: fatprocs.h:1312
WORKER_THREAD_ROUTINE FatFspMarkVolumeDirtyWithRecover
Definition: fatprocs.h:2001
ULONG FatVolumeUncleanCount(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
IN PVCB IN ULONG AbsoluteClusterHint
Definition: fatprocs.h:345
#define INLINE
Definition: fatprocs.h:78
NTSTATUS FatFsdPostRequest(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
Definition: workque.c:229
BOOLEAN NTAPI FatNoOpAcquire(IN PVOID Fcb, IN BOOLEAN Wait)
Definition: resrcsup.c:795
TYPE_OF_OPEN FatDecodeFileObject(_In_ PFILE_OBJECT FileObject, _Outptr_ PVCB *Vcb, _Outptr_ PFCB *FcbOrDcb, _Outptr_ PCCB *Ccb)
Definition: filobsup.c:176
VOID FatPinMappedData(IN PIRP_CONTEXT IrpContext, IN PDCB Dcb, IN VBO StartingVbo, IN ULONG ByteCount, OUT PBCB *Bcb)
Definition: cachesup.c:1866
_In_ PLARGE_INTEGER _In_ BOOLEAN _Out_ PFAT_TIME_STAMP _Out_opt_ PUCHAR TenMsecs
Definition: fatprocs.h:1919
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING IN PUNICODE_STRING SuggestedShortName IN OUT BOOLEAN * AllLowerComponent
Definition: fatprocs.h:1309
VOID FatTunnelFcbOrDcb(IN PFCB FcbOrDcb, IN PCCB Ccb OPTIONAL)
Definition: dirsup.c:652
union _UCHAR1 * PUCHAR1
IN PFCB IN BOOLEAN ReturnOnFailure
Definition: fatprocs.h:773
IN PVCB IN OUT PLARGE_MCB IN VBO OUT PLARGE_MCB RemainingMcb
Definition: fatprocs.h:368
FAT_TIME_STAMP FatGetCurrentFatTime(_In_ PIRP_CONTEXT IrpContext)
Definition: timesup.c:317
PVOID FatBufferUserBuffer(IN PIRP_CONTEXT IrpContext, IN OUT PIRP Irp, IN ULONG BufferLength)
Definition: deviosup.c:3411
NTSTATUS FatPerformDevIoCtrl(IN PIRP_CONTEXT IrpContext, IN ULONG IoControlCode, IN PDEVICE_OBJECT Device, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN BOOLEAN OverrideVerify, OUT PIO_STATUS_BLOCK Iosb OPTIONAL)
Definition: deviosup.c:3621
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN CreateFile
Definition: fatprocs.h:917
FINISHED FatZeroData(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_OBJECT FileObject, IN ULONG StartingZero, IN ULONG ByteCount)
Definition: cachesup.c:1659
VOID FatPreallocateCloseContext(IN PVCB Vcb)
BOOLEAN FatLookupMcbEntry(IN PVCB Vcb, IN PLARGE_MCB Mcb, IN VBO Vbo, OUT PLBO Lbo, OUT PULONG ByteCount OPTIONAL, OUT PULONG Index OPTIONAL)
Definition: fsctrl.c:418
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
Definition: fatprocs.h:2418
PVOID FatMapUserBuffer(IN PIRP_CONTEXT IrpContext, IN OUT PIRP Irp)
Definition: deviosup.c:3357
IN PFCB IN VBO OUT PLBO Lbo
Definition: fatprocs.h:309
IN PFCB IN VBO OUT PLBO OUT PULONG ByteCount
Definition: fatprocs.h:310
IN PDCB IN PCCB IN VBO OffsetToStartSearchFrom
Definition: fatprocs.h:728
VOID FatEvaluateNameCase(IN PIRP_CONTEXT IrpContext, IN PUNICODE_STRING Name, IN OUT BOOLEAN *AllLowerComponent, IN OUT BOOLEAN *AllLowerExtension, IN OUT BOOLEAN *CreateLfn)
Definition: namesup.c:891
VOID FatFlushFatEntries(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN ULONG Cluster, IN ULONG Count)
Definition: flush.c:1191
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:940
@ UnopenedFileObject
Definition: fatprocs.h:1042
@ UserDirectoryOpen
Definition: fatprocs.h:1044
@ DirectoryFile
Definition: fatprocs.h:1047
@ UserFileOpen
Definition: fatprocs.h:1043
@ UserVolumeOpen
Definition: fatprocs.h:1045
@ VirtualVolumeFile
Definition: fatprocs.h:1046
@ EaFile
Definition: fatprocs.h:1048
_In_ PLARGE_INTEGER _In_ BOOLEAN _Out_ PFAT_TIME_STAMP FatTime
Definition: fatprocs.h:1917
NTSTATUS FatFlushFat(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: flush.c:801
PFCB FatCreateFcb(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PDCB ParentDcb, IN ULONG LfnOffsetWithinDirectory, IN ULONG DirentOffsetWithinDirectory, IN PDIRENT Dirent, IN PUNICODE_STRING Lfn OPTIONAL, IN PUNICODE_STRING OrigLfn OPTIONAL, IN BOOLEAN IsPagingFile, IN BOOLEAN SingleResource)
Definition: strucsup.c:1252
VOID NTAPI FatPrePostIrp(IN PVOID Context, IN PIRP Irp)
Definition: workque.c:91
enum _FAT_VOLUME_STATE * PFAT_VOLUME_STATE
VOID FatExamineFatEntries(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN ULONG StartIndex OPTIONAL, IN ULONG EndIndex OPTIONAL, IN BOOLEAN SetupWindows, IN PFAT_WINDOW SwitchToWindow OPTIONAL, IN PULONG BitMapBuffer OPTIONAL)
Definition: allocsup.c:4720
PFCB FatFindFcb(IN PIRP_CONTEXT IrpContext, IN OUT PRTL_SPLAY_LINKS *RootNode, IN PSTRING Name, OUT PBOOLEAN FileNameDos OPTIONAL)
Definition: splaysup.c:306
BOOLEAN FatSpaceInName(IN PIRP_CONTEXT IrpContext, IN PUNICODE_STRING UnicodeName)
Definition: namesup.c:1003
VOID FatConstructNamesInFcb(IN PIRP_CONTEXT IrpContext, PFCB Fcb, PDIRENT Dirent, PUNICODE_STRING Lfn OPTIONAL)
Definition: strucsup.c:3022
VOID FatSetFileObject(IN PFILE_OBJECT FileObject OPTIONAL, IN TYPE_OF_OPEN TypeOfOpen, IN PVOID VcbOrFcbOrDcb, IN PCCB Ccb OPTIONAL)
Definition: filobsup.c:39
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
Definition: fatdata.c:204
CLUSTER_TYPE FatInterpretClusterType(IN PVCB Vcb, IN FAT_ENTRY Entry)
Definition: allocsup.c:3473
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB IN PDEVICE_OBJECT FsDeviceObject
Definition: fatprocs.h:1678
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN BOOLEAN ExclusiveLock
Definition: fatprocs.h:2715
BOOLEAN FatAcquireVolumeForClose(IN PVOID Vcb, IN BOOLEAN Wait)
VOID FatReleaseVolumeFromClose(IN PVOID Vcb)
IN PIRP IN PFCB IN ULONG IN ULONG IN ULONG UserByteCount
Definition: fatprocs.h:594
struct _FAT_ENUMERATION_CONTEXT * PFAT_ENUMERATION_CONTEXT
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
Definition: fatdata.c:817
IN PFCB IN FAT_FLUSH_TYPE FlushType
Definition: fatprocs.h:1083
VOID FatDeleteIrpContext_Real(IN PIRP_CONTEXT IrpContext)
Definition: strucsup.c:2461
IN PDCB ParentDirectory
Definition: fatprocs.h:699
VOID FatCheckDirtyBit(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: verfysup.c:1185
IN PDCB IN PUNICODE_STRING IN PUNICODE_STRING LfnTmp
Definition: fatprocs.h:756
IN PDCB IN ULONG IN ULONG DirentOffset
Definition: fatprocs.h:791
VOID FatExtendString(_Inout_ PVOID String, _In_ USHORT DesiredBufferSize, _In_ BOOLEAN FreeOldBuffer, __out_opt PBOOLEAN NeedsFree)
IN PFCB IN PDELETE_CONTEXT DeleteContext IN BOOLEAN DeleteEa
Definition: fatprocs.h:719
PFCB FatGetNextFcbBottomUp(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb, IN PFCB TerminationFcb)
Definition: strucsup.c:2525
VOID FatDeallocateCcbStrings(IN PCCB Ccb)
Definition: strucsup.c:2209
VOID FatEnsureStringBufferEnough(_Inout_ PVOID String, _In_ USHORT DesiredBufferSize)
Definition: strucsup.c:3739
enum _FAT_FLUSH_TYPE FAT_FLUSH_TYPE
IN PFCB FcbOrDcb
Definition: fatprocs.h:307
BOOLEAN FatGetNextMcbEntry(IN PVCB Vcb, IN PLARGE_MCB Mcb, IN ULONG RunIndex, OUT PVBO Vbo, OUT PLBO Lbo, OUT PULONG ByteCount)
Definition: fsctrl.c:541
VOID FatSetFullNameInFcb(_In_ PIRP_CONTEXT IrpContext, _Inout_ PFCB Fcb, _In_ PUNICODE_STRING FinalName)
Definition: create.c:6718
PFILE_OBJECT FatOpenEaFile(IN PIRP_CONTEXT IrpContext, IN PFCB EaFcb)
Definition: cachesup.c:979
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1676
VOID FatConstructLabelDirent(IN PIRP_CONTEXT IrpContext, IN OUT PDIRENT Dirent, IN POEM_STRING Label)
Definition: dirsup.c:2440
KDEFERRED_ROUTINE FatCleanVolumeDpc
Definition: fatprocs.h:1982
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:428
PMDL FatBuildZeroMdl(__in PIRP_CONTEXT IrpContext, __in ULONG Length)
Definition: deviosup.c:3734
IN PDCB IN ULONG DirentsNeeded
Definition: fatprocs.h:700
BOOLEAN FatCheckFileAccess(PIRP_CONTEXT IrpContext, IN UCHAR DirentAttributes, IN PACCESS_MASK DesiredAccess)
Definition: acchksup.c:39
UCHAR FatLogOf(IN ULONG Value)
Definition: allocsup.c:4655
IN PDCB IN POEM_STRING IN PUNICODE_STRING UnicodeName
Definition: fatprocs.h:1306
IN PVCB IN BOOLEAN NoOpCheck
Definition: fatprocs.h:1459
VOID FatFlushDirentForFile(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb)
Definition: flush.c:1264
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
Definition: fatprocs.h:2667
VOID FatWaitSync(IN PIRP_CONTEXT IrpContext)
Definition: deviosup.c:2367
IN PFCB Fcb
Definition: fatprocs.h:821
VOID FatCompleteRequest_Real(IN PIRP_CONTEXT IrpContext, IN PIRP Irp, IN NTSTATUS Status)
Definition: fatdata.c:733
_COMPARISON
Definition: fatprocs.h:1884
@ IsEqual
Definition: fatprocs.h:1887
@ IsLessThan
Definition: fatprocs.h:1885
@ IsGreaterThan
Definition: fatprocs.h:1886
VOID FatRemoveMcbEntry(IN PVCB Vcb, IN PLARGE_MCB Mcb, IN VBO Vbo, IN ULONG SectorCount)
Definition: fsctrl.c:599
BOOLEAN FatIsHandleCountZero(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: strucsup.c:3614
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:419
union _UCHAR4 UCHAR4
IN PVCB IN OUT PLARGE_MCB IN VBO SplitAtVbo
Definition: fatprocs.h:366
IN PDCB TargetDcb
Definition: fatprocs.h:789
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING ShortName
Definition: fatprocs.h:1307
BOOLEAN FatAddMcbEntry(IN PVCB Vcb, IN PLARGE_MCB Mcb, IN VBO Vbo, IN LBO Lbo, IN ULONG SectorCount)
Definition: fsctrl.c:364
VOID FatUnpinEaRange(IN PIRP_CONTEXT IrpContext, IN OUT PEA_RANGE EaRange)
Definition: easup.c:3782
IN PFCB IN PCCB IN TYPE_OF_OPEN TypeOfOpen
Definition: fatprocs.h:2416
IN PDCB IN PCCB Ccb
Definition: fatprocs.h:727
enum _COMPARISON COMPARISON
VOID FatSingleAsync(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN LBO Lbo, IN ULONG ByteCount, IN PIRP Irp)
Definition: deviosup.c:1990
PCCB FatCreateCcb(IN PIRP_CONTEXT IrpContext)
Definition: strucsup.c:2155
VOID NTAPI FatOplockComplete(IN PVOID Context, IN PIRP Irp)
Definition: workque.c:35
VOID FatAppendPackedEa(IN PIRP_CONTEXT IrpContext, IN OUT PEA_SET_HEADER *EaSetHeader, IN OUT PULONG PackedEasLength, IN OUT PULONG AllocationLength, IN PFILE_FULL_EA_INFORMATION FullEa, IN ULONG BytesPerCluster)
Definition: easup.c:2967
_In_ PLARGE_INTEGER _In_ BOOLEAN Rounding
Definition: fatprocs.h:1916
VOID FatReadVolumeFile(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN VBO StartingVbo, IN ULONG ByteCount, OUT PBCB *Bcb, OUT PVOID *Buffer)
Definition: cachesup.c:102
VOID FatTearDownAllocationSupport(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: allocsup.c:549
IN PLARGE_INTEGER FileOffset
Definition: fatprocs.h:2663
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING IN PUNICODE_STRING SuggestedShortName IN OUT BOOLEAN IN OUT BOOLEAN * AllLowerExtension
Definition: fatprocs.h:1310
IN PIRP IN PFCB IN ULONG IN ULONG IN ULONG IN ULONG StreamFlags
Definition: fatprocs.h:596
VOID FatLockUserBuffer(IN PIRP_CONTEXT IrpContext, IN OUT PIRP Irp, IN LOCK_OPERATION Operation, IN ULONG BufferLength)
Definition: deviosup.c:3276
IN PFCB IN VBO Vbo
Definition: fatprocs.h:308
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ULONG BOOLEAN FailImmediately
Definition: fatprocs.h:2714
IN PFCB IN VBO OUT PLBO OUT PULONG OUT PBOOLEAN OUT PBOOLEAN EndOnMax
Definition: fatprocs.h:312
IN PVCB IN PUCHAR IN ULONG IN POEM_STRING OUT PUSHORT EaHandle
Definition: fatprocs.h:899
NTSTATUS FatCommonSetEa(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
Definition: ea.c:659
VOID FatVerifyVcb(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: verfysup.c:270
NTSTATUS FatPrefetchPages(IN PIRP_CONTEXT IrpContext, IN PFILE_OBJECT FileObject, IN ULONG StartingPage, IN ULONG PageCount)
Definition: cachesup.c:1929
VOID FatVerifyOperationIsLegal(IN PIRP_CONTEXT IrpContext)
Definition: verfysup.c:1304
_Acquires_shared_lock_ Fcb FINISHED FatAcquireSharedFcbWaitForEx(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb)
NTSTATUS FatExplicitDeviceAccessGranted(IN PIRP_CONTEXT IrpContext, IN PDEVICE_OBJECT DeviceObject, IN PACCESS_STATE AccessState, IN KPROCESSOR_MODE ProcessorMode)
Definition: acchksup.c:225
IN PFCB IN VBO OUT PLBO OUT PULONG OUT PBOOLEAN Allocated
Definition: fatprocs.h:311
VOID FatDeletePackedEa(IN PIRP_CONTEXT IrpContext, IN OUT PEA_SET_HEADER EaSetHeader, IN OUT PULONG PackedEasLength, IN ULONG Offset)
Definition: easup.c:3148
IN PVCB IN PDIRENT OUT PULONG EaLength
Definition: fatprocs.h:879
_FAT_FLUSH_TYPE
Definition: fatprocs.h:1052
@ FlushWithoutPurge
Definition: fatprocs.h:1057
@ Flush
Definition: fatprocs.h:1055
@ FlushAndInvalidate
Definition: fatprocs.h:1056
@ NoFlush
Definition: fatprocs.h:1054
VOID FatSyncUninitializeCacheMap(IN PIRP_CONTEXT IrpContext, IN PFILE_OBJECT FileObject)
Definition: cachesup.c:1812
IN PVCB IN ULONG FatIndex
Definition: fatprocs.h:384
BOOLEAN FatIsBootSectorFat(IN PPACKED_BOOT_SECTOR BootSector)
Definition: fsctrl.c:2522
PDCB FatCreateDcb(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PDCB ParentDcb, IN ULONG LfnOffsetWithinDirectory, IN ULONG DirentOffsetWithinDirectory, IN PDIRENT Dirent, IN PUNICODE_STRING Lfn OPTIONAL)
Definition: strucsup.c:1623
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
Definition: fatprocs.h:732
BOOLEAN FatIsNameInExpression(IN PIRP_CONTEXT IrpContext, IN OEM_STRING Expression, IN OEM_STRING Name)
Definition: namesup.c:35
IN PFCB IN PFILE_OBJECT FileObject IN ULONG AllocationSize
Definition: fatprocs.h:323
WORKER_THREAD_ROUTINE FatFspDispatch
Definition: fatprocs.h:2381
VOID FatLookupFatEntry(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN ULONG FatIndex, IN OUT PULONG FatEntry, IN OUT PFAT_ENUMERATION_CONTEXT Context)
Definition: allocsup.c:3565
VOID FatRemoveNames(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb)
Definition: splaysup.c:222
VOID Fat8dot3ToString(_In_ PIRP_CONTEXT IrpContext, _In_ PDIRENT Dirent, _In_ BOOLEAN RestoreCase, _Out_ POEM_STRING OutputString)
Definition: namesup.c:179
VOID FatConstructDirent(IN PIRP_CONTEXT IrpContext, IN OUT PDIRENT Dirent, IN POEM_STRING FileName, IN BOOLEAN ComponentReallyLowercase, IN BOOLEAN ExtensionReallyLowercase, IN PUNICODE_STRING Lfn OPTIONAL, IN USHORT Attributes, IN BOOLEAN ZeroAndSetTimeFields, IN PLARGE_INTEGER SetCreationTime OPTIONAL)
Definition: dirsup.c:2171
IN PVCB IN ULONG IN FAT_ENTRY FatEntry
Definition: fatprocs.h:386
IN OUT PVCB OUT PDIRENT OUT PBCB * EaBcb
Definition: fatprocs.h:916
union _UCHAR4 * PUCHAR4
enum _TYPE_OF_OPEN TYPE_OF_OPEN
enum _FAT_VOLUME_STATE FAT_VOLUME_STATE
union _UCHAR2 * PUCHAR2
ULONG FatLocateNextEa(IN PIRP_CONTEXT IrpContext, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, IN ULONG PreviousOffset)
Definition: easup.c:3257
LARGE_INTEGER FatFatTimeToNtTime(_In_ PIRP_CONTEXT IrpContext, _In_ FAT_TIME_STAMP FatTime, _In_ UCHAR TenMilliSeconds)
Definition: timesup.c:233
IN PVCB IN FAT_VOLUME_STATE VolumeState
Definition: fatprocs.h:1999
BOOLEAN FatScanForDataTrack(IN PIRP_CONTEXT IrpContext, IN PDEVICE_OBJECT TargetDeviceObject)
Definition: strucsup.c:3828
VOID FatMultipleAsync(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PIRP Irp, IN ULONG MultipleIrpCount, IN PIO_RUN IoRuns)
Definition: deviosup.c:1622
VOID FatFreeStringBuffer(_Inout_ PVOID String)
Definition: strucsup.c:3784
union _UCHAR1 UCHAR1
IN PDCB IN POEM_STRING OemName
Definition: fatprocs.h:1305
PCLOSE_CONTEXT FatAllocateCloseContext(IN PVCB Vcb)
struct _FAT_ENUMERATION_CONTEXT FAT_ENUMERATION_CONTEXT
IN OUT PVCB OUT PDIRENT OUT PBCB IN BOOLEAN IN BOOLEAN ExclusiveFcb
Definition: fatprocs.h:919
NTSTATUS FatHijackIrpAndFlushDevice(IN PIRP_CONTEXT IrpContext, IN PIRP Irp, IN PDEVICE_OBJECT TargetDeviceObject)
Definition: flush.c:1101
IN PDCB IN PDIRENT ParentDirent
Definition: fatprocs.h:710
BOOLEAN FINISHED
Definition: fatprocs.h:105
LARGE_INTEGER FatFatDateToNtTime(_In_ PIRP_CONTEXT IrpContext, _In_ FAT_DATE FatDate)
Definition: timesup.c:171
VOID FatPagingFileIo(IN PIRP Irp, IN PFCB Fcb)
Definition: deviosup.c:211
VOID FatSetupAllocationSupport(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: allocsup.c:359
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:349
BOOLEAN FatLocateEaByName(IN PIRP_CONTEXT IrpContext, IN PPACKED_EA FirstPackedEa, IN ULONG PackedEasLength, IN POEM_STRING EaName, OUT PULONG Offset)
Definition: easup.c:3344
IN OUT PVCB OUT PDIRENT * EaDirent
Definition: fatprocs.h:915
VOID FatRepinBcb(IN PIRP_CONTEXT IrpContext, IN PBCB Bcb)
Definition: cachesup.c:1317
IN PIRP IN NTSTATUS ExceptionCode
Definition: fatprocs.h:2936
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2712
VOID FatMarkFcbCondition(IN PIRP_CONTEXT IrpContext, IN PFCB Fcb, IN FCB_CONDITION FcbCondition, IN BOOLEAN Recursive)
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN Reversible
Definition: fatprocs.h:417
IN PVCB IN PDIRENT OUT PULONG NeedEaCount
Definition: fatprocs.h:888
IN PDCB Parent
Definition: fatprocs.h:1304
COMPARISON FatCompareNames(IN PSTRING NameA, IN PSTRING NameB)
Definition: splaysup.c:421
IN PVCB IN OUT PLARGE_MCB IN PLARGE_MCB SecondMcb
Definition: fatprocs.h:377
NTSTATUS FatCompleteMdl(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
Definition: cachesup.c:1728
BOOLEAN FatIsEaNameValid(IN PIRP_CONTEXT IrpContext, IN OEM_STRING Name)
Definition: easup.c:3429
BOOLEAN FatCheckManageVolumeAccess(_In_ PIRP_CONTEXT IrpContext, _In_ PACCESS_STATE AccessState, _In_ KPROCESSOR_MODE ProcessorMode)
Definition: acchksup.c:176
VOID NTAPI FatNoOpRelease(IN PVOID Fcb)
Definition: resrcsup.c:842
VOID FatTearDownVcb(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb)
Definition: strucsup.c:684
VOID FatAddToWorkque(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
Definition: workque.c:280
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
Definition: strucsup.c:2301
BOOLEAN FatLookupLastMcbEntry(IN PVCB Vcb, IN PLARGE_MCB Mcb, OUT PVBO Vbo, OUT PLBO Lbo, OUT PULONG Index OPTIONAL)
Definition: fsctrl.c:494
PVCB IN BOOLEAN Force
Definition: fatprocs.h:1805
VOID FatReadEaSet(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN USHORT EaHandle, IN POEM_STRING FileName, IN BOOLEAN ReturnEntireSet, OUT PEA_RANGE EaSetRange)
Definition: easup.c:1306
IN PDCB Dcb
Definition: fatprocs.h:425
static INLINE BOOLEAN FatIsIoRangeValid(IN PVCB Vcb, IN LARGE_INTEGER Start, IN ULONG Length)
Definition: fatprocs.h:219
IN PVCB IN PLARGE_MCB IN BOOLEAN ZeroOnDeallocate
Definition: fatprocs.h:358
enum _CLUSTER_TYPE CLUSTER_TYPE
FP_OP Operation
Definition: fpcontrol.c:150
#define FsRtlIsAnsiCharacterLegalHpfs(C, WILD)
Definition: fsrtlfuncs.h:1614
_Must_inspect_result_ _In_ ULONG RunIndex
Definition: fsrtlfuncs.h:538
return pTarget Start()
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19
* PNTSTATUS
Definition: strlen.c:14
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
DRIVER_DISPATCH(nfs41_FsdDispatch)
#define _Out_opt_
Definition: no_sal2.h:214
#define _Inout_
Definition: no_sal2.h:162
#define _Success_(c)
Definition: no_sal2.h:84
#define _Outptr_
Definition: no_sal2.h:262
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Function_class_(n)
Definition: no_sal2.h:398
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
#define _When_(c, a)
Definition: no_sal2.h:38
int Count
Definition: noreturn.cpp:7
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
ULONG SectorCount
Definition: part_xbox.c:31
unsigned short USHORT
Definition: pedump.c:61
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
base of all file and directory entries
Definition: entries.h:83
Definition: fsck.fat.h:192
Definition: cdstruc.h:1067
Definition: fat.h:274
Definition: cdstruc.h:902
Definition: ketypes.h:699
Definition: cdstruc.h:498
Definition: iotypes.h:189
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
STRING OEM_STRING
Definition: umtypes.h:203
UCHAR ForceAlignment
Definition: cdprocs.h:1663
USHORT ForceAlignment
Definition: cdprocs.h:1668
ULONG ForceAlignment
Definition: cdprocs.h:1673
unsigned char Uchar
Definition: utypes.h:45
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_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
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:112
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE _In_opt_ __drv_aliasesMem WDFCONTEXT CompletionContext
Definition: wdfrequest.h:898
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG _In_ BOOLEAN InternalDeviceIoControl
Definition: iofuncs.h:720
#define IRP_MJ_QUERY_EA
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define IRP_MJ_SET_VOLUME_INFORMATION
#define IRP_MJ_SET_EA
* PFILE_OBJECT
Definition: iotypes.h:1998
#define IRP_MJ_FLUSH_BUFFERS
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_CLEANUP
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
enum _LOCK_OPERATION LOCK_OPERATION
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:688
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:687
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:689
#define NT_ASSERT
Definition: rtlfuncs.h:3327
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1577
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
Definition: sefuncs.h:417
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180