49#define FAT_SHIFT10000 13
52#define FAT_SHIFT86400000 26
54#define FatConvert100nsToMilliseconds(LARGE_INTEGER) ( \
55 RtlExtendedMagicDivide( (LARGE_INTEGER), FatMagic10000, FAT_SHIFT10000 )\
58#define FatConvertMillisecondsToDays(LARGE_INTEGER) ( \
59 RtlExtendedMagicDivide( (LARGE_INTEGER), FatMagic86400000, FAT_SHIFT86400000 ) \
62#define FatConvertDaysToMilliseconds(DAYS) ( \
63 Int32x32To64( (DAYS), 86400000 ) \
70#define FAT_RESERVE_MDL_SIZE 16
95#define READ_AHEAD_GRANULARITY (0x10000)
102#define FAT_MAX_IO_RUNS_ON_STACK ((ULONG) 5)
108#define FAT_MAX_DELAYED_CLOSES ((ULONG)16)
116#define FAT_DEFAULT_DEFRAG_CHUNK_IN_BYTES (0x10000)
122#define TenMSec (10*1000*10)
123#define TwoSeconds (2*1000*1000*10)
124#define AlmostTenMSec (TenMSec - 1)
125#define AlmostTwoSeconds (TwoSeconds - 1)
129#define HighPartPerDay (52734375 >> 18)
180#define DEBUG_TRACE_ERROR (0x00000001)
181#define DEBUG_TRACE_DEBUG_HOOKS (0x00000002)
182#define DEBUG_TRACE_CATCH_EXCEPTIONS (0x00000004)
183#define DEBUG_TRACE_UNWIND (0x00000008)
184#define DEBUG_TRACE_CLEANUP (0x00000010)
185#define DEBUG_TRACE_CLOSE (0x00000020)
186#define DEBUG_TRACE_CREATE (0x00000040)
187#define DEBUG_TRACE_DIRCTRL (0x00000080)
188#define DEBUG_TRACE_EA (0x00000100)
189#define DEBUG_TRACE_FILEINFO (0x00000200)
190#define DEBUG_TRACE_FSCTRL (0x00000400)
191#define DEBUG_TRACE_LOCKCTRL (0x00000800)
192#define DEBUG_TRACE_READ (0x00001000)
193#define DEBUG_TRACE_VOLINFO (0x00002000)
194#define DEBUG_TRACE_WRITE (0x00004000)
195#define DEBUG_TRACE_FLUSH (0x00008000)
196#define DEBUG_TRACE_DEVCTRL (0x00010000)
197#define DEBUG_TRACE_SHUTDOWN (0x00020000)
198#define DEBUG_TRACE_FATDATA (0x00040000)
199#define DEBUG_TRACE_PNP (0x00080000)
200#define DEBUG_TRACE_ACCHKSUP (0x00100000)
201#define DEBUG_TRACE_ALLOCSUP (0x00200000)
202#define DEBUG_TRACE_DIRSUP (0x00400000)
203#define DEBUG_TRACE_FILOBSUP (0x00800000)
204#define DEBUG_TRACE_NAMESUP (0x01000000)
205#define DEBUG_TRACE_VERFYSUP (0x02000000)
206#define DEBUG_TRACE_CACHESUP (0x04000000)
207#define DEBUG_TRACE_SPLAYSUP (0x08000000)
208#define DEBUG_TRACE_DEVIOSUP (0x10000000)
209#define DEBUG_TRACE_STRUCSUP (0x20000000)
210#define DEBUG_TRACE_FSP_DISPATCHER (0x40000000)
211#define DEBUG_TRACE_FSP_DUMP (0x80000000)
213extern LONG FatDebugTraceLevel;
214extern LONG FatDebugTraceIndent;
216#define DebugTrace(INDENT,LEVEL,X,Y) { \
218 if (((LEVEL) == 0) || (FatDebugTraceLevel & (LEVEL))) { \
219 _i = (ULONG)PsGetCurrentThread(); \
220 DbgPrint("%08lx:",_i); \
221 if ((INDENT) < 0) { \
222 FatDebugTraceIndent += (INDENT); \
224 if (FatDebugTraceIndent < 0) { \
225 FatDebugTraceIndent = 0; \
227 for (_i = 0; _i < FatDebugTraceIndent; _i += 1) { \
231 if ((INDENT) > 0) { \
232 FatDebugTraceIndent += (INDENT); \
237#if !defined(__REACTOS__) || defined(_MSC_VER)
238#define DebugDump(STR,LEVEL,PTR) { \
239 __pragma(warning(push)) \
240 __pragma(warning(disable:4210)) \
242 VOID FatDump(IN PVOID Ptr); \
243 if (((LEVEL) == 0) || (FatDebugTraceLevel & (LEVEL))) { \
244 _i = (ULONG)PsGetCurrentThread(); \
245 DbgPrint("%08lx:",_i); \
247 if (PTR != NULL) {FatDump(PTR);} \
250 __pragma(warning(pop)) \
253#define DebugDump(STR,LEVEL,PTR) { \
255 VOID FatDump(IN PVOID Ptr); \
256 if (((LEVEL) == 0) || (FatDebugTraceLevel & (LEVEL))) { \
257 _i = (ULONG)PsGetCurrentThread(); \
258 DbgPrint("%08lx:",_i); \
260 if (PTR != NULL) {FatDump(PTR);} \
266#define DebugUnwind(X) { \
267 if (_SEH2_AbnormalTermination()) { \
268 DebugTrace(0, DEBUG_TRACE_UNWIND, #X ", Abnormal termination.\n", 0); \
281extern ULONG FatFsdEntryCount;
282extern ULONG FatFspEntryCount;
283extern ULONG FatIoCallDriverCount;
284extern ULONG FatTotalTicks[];
286#define DebugDoit(X) {X;}
288extern LONG FatPerformanceTimerLevel;
290#define TimerStart(LEVEL) { \
291 LARGE_INTEGER TStart, TEnd; \
292 LARGE_INTEGER TElapsed; \
293 TStart = KeQueryPerformanceCounter( NULL ); \
295#define TimerStop(LEVEL,s) \
296 TEnd = KeQueryPerformanceCounter( NULL ); \
297 TElapsed.QuadPart = TEnd.QuadPart - TStart.QuadPart; \
298 FatTotalTicks[FatLogOf(LEVEL)] += TElapsed.LowPart; \
299 if (FlagOn( FatPerformanceTimerLevel, (LEVEL))) { \
300 DbgPrint("Time of %s %ld\n", (s), TElapsed.LowPart ); \
313#define DebugTrace(INDENT,LEVEL,X,Y) {NOTHING;}
314#define DebugDump(STR,LEVEL,PTR) {NOTHING;}
315#define DebugUnwind(X) {NOTHING;}
316#define DebugDoit(X) {NOTHING;}
318#define TimerStart(LEVEL)
319#define TimerStop(LEVEL,s)
332#define DbgDoit(X) {X;}
336#define DbgDoit(X) {NOTHING;}
342extern NTSTATUS FatBreakOnInterestingIoCompletion;
343extern NTSTATUS FatBreakOnInterestingExceptionStatus;
344extern NTSTATUS FatBreakOnInterestingIrpCompletion;
346extern BOOLEAN FatTestRaisedStatus;
NPAGED_LOOKASIDE_LIST FatNonPagedFcbLookasideList
FAST_MUTEX FatCloseQueueMutex
PDEVICE_OBJECT FatDiskFileSystemDeviceObject
LARGE_INTEGER FatJanOne1980
LARGE_INTEGER FatDecThirtyOne1979
LARGE_INTEGER Fat30Milliseconds
FAT_TIME_STAMP FatTimeJanOne1980
SLIST_HEADER FatCloseContextSList
LOGICAL FatDiskAccountingEnabled
LARGE_INTEGER FatMaxLarge
LARGE_INTEGER FatLargeZero
ULONG FatMaxDelayedCloseCount
LARGE_INTEGER FatOneSecond
NPAGED_LOOKASIDE_LIST FatIrpContextLookasideList
LARGE_INTEGER FatMagic10000
NPAGED_LOOKASIDE_LIST FatEResourceLookasideList
FAST_IO_DISPATCH FatFastIoDispatch
__volatile PMDL FatReserveMdl
LARGE_INTEGER FatMagic86400000
IO_STATUS_BLOCK FatGarbageIosb
LARGE_INTEGER Fat100Milliseconds
PDEVICE_OBJECT FatCdromFileSystemDeviceObject
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST