[NTOS:MM] Make x64 address space layout more like Vista+
[reactos.git] / ntoskrnl / include / internal / fsrtl.h
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/internal/fsrtl.h
5 * PURPOSE: Internal header for the File System Runtime Library
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 //
10 // Define this if you want debugging support
11 //
12 #define _FSRTL_DEBUG_ 0x00
13
14 //
15 // These define the Debug Masks Supported
16 //
17 #define FSRTL_FASTIO_DEBUG 0x01
18 #define FSRTL_OPLOCK_DEBUG 0x02
19 #define FSRTL_TUNNEL_DEBUG 0x04
20 #define FSRTL_MCB_DEBUG 0x08
21 #define FSRTL_NAME_DEBUG 0x10
22 #define FSRTL_NOTIFY_DEBUG 0x20
23 #define FSRTL_FILELOCK_DEBUG 0x40
24 #define FSRTL_UNC_DEBUG 0x80
25 #define FSRTL_FILTER_DEBUG 0x100
26 #define FSRTL_CONTEXT_DEBUG 0x200
27
28 //
29 // Debug/Tracing support
30 //
31 #if _FSRTL_DEBUG_
32 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
33 #define FSTRACE DbgPrintEx
34 #else
35 #define FSTRACE(x, ...) \
36 if (x & FsRtlpTraceLevel) DbgPrint(__VA_ARGS__)
37 #endif
38 #else
39 #define FSTRACE(x, ...) DPRINT(__VA_ARGS__)
40 #endif
41
42 //
43 // Number of internal ERESOURCE structures allocated for callers to request
44 //
45 #define FSRTL_MAX_RESOURCES 16
46
47 //
48 // Number of maximum pair count per MCB
49 //
50 #define MAXIMUM_PAIR_COUNT 15
51
52 //
53 // Notifications flags
54 //
55 #define WATCH_TREE 0x01
56 #define NOTIFY_IMMEDIATELY 0x02
57 #define CLEANUP_IN_PROCESS 0x04
58 #define NOTIFY_LATER 0x08
59 #define WATCH_ROOT 0x10
60 #define DELETE_IN_PROCESS 0x20
61
62 //
63 // Internal structure for NOTIFY_SYNC
64 //
65 typedef struct _REAL_NOTIFY_SYNC
66 {
67 FAST_MUTEX FastMutex;
68 ULONG_PTR OwningThread;
69 ULONG OwnerCount;
70 } REAL_NOTIFY_SYNC, * PREAL_NOTIFY_SYNC;
71
72 //
73 // Internal structure for notifications
74 //
75 typedef struct _NOTIFY_CHANGE
76 {
77 PREAL_NOTIFY_SYNC NotifySync;
78 PVOID FsContext;
79 PVOID StreamID;
80 PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback;
81 PSECURITY_SUBJECT_CONTEXT SubjectContext;
82 PSTRING FullDirectoryName;
83 LIST_ENTRY NotifyList;
84 LIST_ENTRY NotifyIrps;
85 PFILTER_REPORT_CHANGE FilterCallback;
86 USHORT Flags;
87 UCHAR CharacterSize;
88 ULONG CompletionFilter;
89 PVOID AllocatedBuffer;
90 PVOID Buffer;
91 ULONG BufferLength;
92 ULONG ThisBufferLength;
93 ULONG DataLength;
94 ULONG LastEntry;
95 ULONG ReferenceCount;
96 PEPROCESS OwningProcess;
97 } NOTIFY_CHANGE, *PNOTIFY_CHANGE;
98
99 //
100 // Internal structure for MCB Mapping pointer
101 //
102 typedef struct _INT_MAPPING
103 {
104 VBN Vbn;
105 LBN Lbn;
106 } INT_MAPPING, *PINT_MAPPING;
107
108 //
109 // Initialization Routines
110 //
111 VOID
112 NTAPI
113 FsRtlInitializeLargeMcbs(
114 VOID
115 );
116
117 VOID
118 NTAPI
119 FsRtlInitializeTunnels(
120 VOID
121 );
122
123 //
124 // File contexts Routines
125 //
126 VOID
127 NTAPI
128 FsRtlPTeardownPerFileObjectContexts(
129 IN PFILE_OBJECT FileObject
130 );
131
132 BOOLEAN
133 NTAPI
134 FsRtlInitSystem(
135 VOID
136 );
137
138 //
139 // Global data inside the File System Runtime Library
140 //
141 extern PERESOURCE FsRtlPagingIoResources;
142 extern PAGED_LOOKASIDE_LIST FsRtlFileLockLookasideList;