xref: /reactos/sdk/include/ddk/fltuserstructures.h (revision 40462c92)
1 /*
2  * fltuserstructures.h
3  *
4  * This file is part of the ReactOS DDK package.
5  *
6  * Contributors:
7  *   Amine Khaldi (amine.khaldi@reactos.org)
8  *
9  * THIS SOFTWARE IS NOT COPYRIGHTED
10  *
11  * This source code is offered for use in the public domain. You may
12  * use, modify or distribute it freely.
13  *
14  * This code is distributed in the hope that it will be useful but
15  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16  * DISCLAIMED. This includes but is not limited to warranties of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  */
20 #pragma once
21 
22 #ifndef __FLT_USER_STRUCTURES_H__
23 #define __FLT_USER_STRUCTURES_H__
24 
25 #if FLT_MGR_BASELINE
26 
27 #define FLTAPI NTAPI
28 
29 #define FILTER_NAME_MAX_CHARS 255
30 #define FILTER_NAME_MAX_BYTES (FILTER_NAME_MAX_CHARS * sizeof(WCHAR))
31 #define VOLUME_NAME_MAX_CHARS 1024
32 #define VOLUME_NAME_MAX_BYTES (VOLUME_NAME_MAX_CHARS * sizeof(WCHAR))
33 #define INSTANCE_NAME_MAX_CHARS 255
34 #define INSTANCE_NAME_MAX_BYTES (INSTANCE_NAME_MAX_CHARS * sizeof(WCHAR))
35 
36 typedef HANDLE HFILTER, HFILTER_INSTANCE, HFILTER_VOLUME;
37 
38 #ifndef _NTDEF_H
39 typedef _Return_type_success_(return >= 0) LONG NTSTATUS, *PNTSTATUS;
40 #endif
41 
42 /* Known File System Types */
43 
44 typedef enum _FLT_FILESYSTEM_TYPE {
45   FLT_FSTYPE_UNKNOWN,
46   FLT_FSTYPE_RAW,
47   FLT_FSTYPE_NTFS,
48   FLT_FSTYPE_FAT,
49   FLT_FSTYPE_CDFS,
50   FLT_FSTYPE_UDFS,
51   FLT_FSTYPE_LANMAN,
52   FLT_FSTYPE_WEBDAV,
53   FLT_FSTYPE_RDPDR,
54   FLT_FSTYPE_NFS,
55   FLT_FSTYPE_MS_NETWARE,
56   FLT_FSTYPE_NETWARE,
57   FLT_FSTYPE_BSUDF,
58   FLT_FSTYPE_MUP,
59   FLT_FSTYPE_RSFX,
60   FLT_FSTYPE_ROXIO_UDF1,
61   FLT_FSTYPE_ROXIO_UDF2,
62   FLT_FSTYPE_ROXIO_UDF3,
63   FLT_FSTYPE_TACIT,
64   FLT_FSTYPE_FS_REC,
65   FLT_FSTYPE_INCD,
66   FLT_FSTYPE_INCD_FAT,
67   FLT_FSTYPE_EXFAT,
68   FLT_FSTYPE_PSFS,
69   FLT_FSTYPE_GPFS,
70   FLT_FSTYPE_NPFS,
71   FLT_FSTYPE_MSFS,
72   FLT_FSTYPE_CSVFS
73 } FLT_FILESYSTEM_TYPE, *PFLT_FILESYSTEM_TYPE;
74 
75 typedef enum _FILTER_INFORMATION_CLASS {
76   FilterFullInformation,
77   FilterAggregateBasicInformation,
78   FilterAggregateStandardInformation
79 } FILTER_INFORMATION_CLASS, *PFILTER_INFORMATION_CLASS;
80 
81 typedef enum _FILTER_VOLUME_INFORMATION_CLASS {
82   FilterVolumeBasicInformation,
83   FilterVolumeStandardInformation
84 } FILTER_VOLUME_INFORMATION_CLASS, *PFILTER_VOLUME_INFORMATION_CLASS;
85 
86 typedef enum _INSTANCE_INFORMATION_CLASS {
87   InstanceBasicInformation,
88   InstancePartialInformation,
89   InstanceFullInformation,
90   InstanceAggregateStandardInformation
91 } INSTANCE_INFORMATION_CLASS, *PINSTANCE_INFORMATION_CLASS;
92 
93 typedef struct _FILTER_FULL_INFORMATION {
94   ULONG NextEntryOffset;
95   ULONG FrameID;
96   ULONG NumberOfInstances;
97   USHORT FilterNameLength;
98   WCHAR FilterNameBuffer[1];
99 } FILTER_FULL_INFORMATION, *PFILTER_FULL_INFORMATION;
100 
101 typedef struct _FILTER_AGGREGATE_BASIC_INFORMATION {
102   ULONG NextEntryOffset;
103   ULONG Flags;
104   union {
105     struct {
106       ULONG FrameID;
107       ULONG NumberOfInstances;
108       USHORT FilterNameLength;
109       USHORT FilterNameBufferOffset;
110       USHORT FilterAltitudeLength;
111       USHORT FilterAltitudeBufferOffset;
112     } MiniFilter;
113     struct {
114       USHORT FilterNameLength;
115       USHORT FilterNameBufferOffset;
116     } LegacyFilter;
117   } Type;
118 } FILTER_AGGREGATE_BASIC_INFORMATION, *PFILTER_AGGREGATE_BASIC_INFORMATION;
119 
120 #if FLT_MGR_LONGHORN
121 
122 #define FLTFL_AGGREGATE_INFO_IS_MINIFILTER   0x00000001
123 #define FLTFL_AGGREGATE_INFO_IS_LEGACYFILTER 0x00000002
124 #define FLTFL_ASI_IS_MINIFILTER              0x00000001
125 #define FLTFL_ASI_IS_LEGACYFILTER            0x00000002
126 #define FLTFL_VSI_DETACHED_VOLUME            0x00000001
127 #define FLTFL_IASI_IS_MINIFILTER             0x00000001
128 #define FLTFL_IASI_IS_LEGACYFILTER           0x00000002
129 #define FLTFL_IASIM_DETACHED_VOLUME          0x00000001
130 #define FLTFL_IASIL_DETACHED_VOLUME          0x00000001
131 
132 typedef struct _FILTER_AGGREGATE_STANDARD_INFORMATION {
133   ULONG NextEntryOffset;
134   ULONG Flags;
135   union {
136     struct {
137       ULONG Flags;
138       ULONG FrameID;
139       ULONG NumberOfInstances;
140       USHORT FilterNameLength;
141       USHORT FilterNameBufferOffset;
142       USHORT FilterAltitudeLength;
143       USHORT FilterAltitudeBufferOffset;
144     } MiniFilter;
145     struct {
146       ULONG Flags;
147       USHORT FilterNameLength;
148       USHORT FilterNameBufferOffset;
149       USHORT FilterAltitudeLength;
150       USHORT FilterAltitudeBufferOffset;
151     } LegacyFilter;
152   } Type;
153 } FILTER_AGGREGATE_STANDARD_INFORMATION, *PFILTER_AGGREGATE_STANDARD_INFORMATION;
154 
155 typedef struct _FILTER_VOLUME_STANDARD_INFORMATION {
156   ULONG NextEntryOffset;
157   ULONG Flags;
158   ULONG FrameID;
159   FLT_FILESYSTEM_TYPE FileSystemType;
160   USHORT FilterVolumeNameLength;
161   WCHAR FilterVolumeName[1];
162 } FILTER_VOLUME_STANDARD_INFORMATION, *PFILTER_VOLUME_STANDARD_INFORMATION;
163 
164 typedef struct _INSTANCE_AGGREGATE_STANDARD_INFORMATION {
165   ULONG NextEntryOffset;
166   ULONG Flags;
167   union {
168     struct {
169       ULONG Flags;
170       ULONG FrameID;
171       FLT_FILESYSTEM_TYPE VolumeFileSystemType;
172       USHORT InstanceNameLength;
173       USHORT InstanceNameBufferOffset;
174       USHORT AltitudeLength;
175       USHORT AltitudeBufferOffset;
176       USHORT VolumeNameLength;
177       USHORT VolumeNameBufferOffset;
178       USHORT FilterNameLength;
179       USHORT FilterNameBufferOffset;
180     } MiniFilter;
181     struct {
182       ULONG Flags;
183       USHORT AltitudeLength;
184       USHORT AltitudeBufferOffset;
185       USHORT VolumeNameLength;
186       USHORT VolumeNameBufferOffset;
187       USHORT FilterNameLength;
188       USHORT FilterNameBufferOffset;
189     } LegacyFilter;
190   } Type;
191 } INSTANCE_AGGREGATE_STANDARD_INFORMATION, *PINSTANCE_AGGREGATE_STANDARD_INFORMATION;
192 
193 #endif /* FLT_MGR_LONGHORN */
194 
195 typedef struct _FILTER_VOLUME_BASIC_INFORMATION {
196   USHORT FilterVolumeNameLength;
197   WCHAR FilterVolumeName[1];
198 } FILTER_VOLUME_BASIC_INFORMATION, *PFILTER_VOLUME_BASIC_INFORMATION;
199 
200 typedef
201 _Struct_size_bytes_(sizeof(INSTANCE_BASIC_INFORMATION) * InstanceNameLength)
202 struct _INSTANCE_BASIC_INFORMATION {
203   ULONG NextEntryOffset;
204   USHORT InstanceNameLength;
205   USHORT InstanceNameBufferOffset;
206 } INSTANCE_BASIC_INFORMATION, *PINSTANCE_BASIC_INFORMATION;
207 
208 typedef
209 _Struct_size_bytes_(sizeof(INSTANCE_PARTIAL_INFORMATION) + InstanceNameLength + AltitudeLength)
210 struct _INSTANCE_PARTIAL_INFORMATION {
211   ULONG NextEntryOffset;
212   USHORT InstanceNameLength;
213   USHORT InstanceNameBufferOffset;
214   USHORT AltitudeLength;
215   USHORT AltitudeBufferOffset;
216 } INSTANCE_PARTIAL_INFORMATION, *PINSTANCE_PARTIAL_INFORMATION;
217 
218 typedef
219 _Struct_size_bytes_(sizeof(INSTANCE_FULL_INFORMATION) + InstanceNameLength + AltitudeLength + VolumeNameLength + FilterNameLength)
220 struct _INSTANCE_FULL_INFORMATION {
221   ULONG NextEntryOffset;
222   USHORT InstanceNameLength;
223   USHORT InstanceNameBufferOffset;
224   USHORT AltitudeLength;
225   USHORT AltitudeBufferOffset;
226   USHORT VolumeNameLength;
227   USHORT VolumeNameBufferOffset;
228   USHORT FilterNameLength;
229   USHORT FilterNameBufferOffset;
230 } INSTANCE_FULL_INFORMATION, *PINSTANCE_FULL_INFORMATION;
231 
232 typedef struct _FILTER_MESSAGE_HEADER {
233   ULONG ReplyLength;
234   ULONGLONG MessageId;
235 } FILTER_MESSAGE_HEADER, *PFILTER_MESSAGE_HEADER;
236 
237 typedef struct _FILTER_REPLY_HEADER {
238   NTSTATUS Status;
239   ULONGLONG MessageId;
240 } FILTER_REPLY_HEADER, *PFILTER_REPLY_HEADER;
241 
242 #endif /* FLT_MGR_BASELINE */
243 
244 #endif /* __FLT_USER_STRUCTURES_H__ */
245