xref: /reactos/sdk/include/ddk/fltuser.h (revision d6eebaa4)
1 /*
2  * fltuser.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 __FLTUSER_H__
23 #define __FLTUSER_H__
24 
25 #define FLT_MGR_BASELINE (((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WIN2KSP4))) || \
26                           ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WINXPSP2))) || \
27                           ((OSVER(NTDDI_VERSION) == NTDDI_WS03)  && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WS03SP1))) ||  \
28                           (NTDDI_VERSION >= NTDDI_VISTA))
29 
30 #define FLT_MGR_AFTER_XPSP2 (((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WIN2KSP4))) ||  \
31                              ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) >  SPVER(NTDDI_WINXPSP2))) ||  \
32                              ((OSVER(NTDDI_VERSION) == NTDDI_WS03)  && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WS03SP1))) ||   \
33                              (NTDDI_VERSION >= NTDDI_VISTA))
34 
35 #define FLT_MGR_LONGHORN (NTDDI_VERSION >= NTDDI_VISTA)
36 #define FLT_MGR_WIN7 (NTDDI_VERSION >= NTDDI_WIN7)
37 
38 #include <fltuserstructures.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 #if FLT_MGR_BASELINE
45 
46 #if FLT_MGR_LONGHORN
47 #define FLT_ASSERT(_e) NT_ASSERT(_e)
48 #define FLT_ASSERTMSG(_m, _e) NT_ASSERTMSG(_m, _e)
49 #else
50 #define FLT_ASSERT(_e) ASSERT(_e)
51 #define FLT_ASSERTMSG(_m, _e) ASSERTMSG(_m, _e)
52 #endif /* FLT_MGR_LONGHORN */
53 
54 _Must_inspect_result_
55 HRESULT
56 WINAPI
57 FilterLoad(
58     _In_ LPCWSTR lpFilterName);
59 
60 _Must_inspect_result_
61 HRESULT
62 WINAPI
63 FilterUnload(
64     _In_ LPCWSTR lpFilterName);
65 
66 _Must_inspect_result_
67 HRESULT
68 WINAPI
69 FilterCreate(
70     _In_ LPCWSTR lpFilterName,
71     _Outptr_ HFILTER *hFilter);
72 
73 HRESULT
74 WINAPI
75 FilterClose(
76     _In_ HFILTER hFilter);
77 
78 _Must_inspect_result_
79 HRESULT
80 WINAPI
81 FilterInstanceCreate(
82     _In_ LPCWSTR lpFilterName,
83     _In_ LPCWSTR lpVolumeName,
84     _In_opt_ LPCWSTR lpInstanceName,
85    _Outptr_ HFILTER_INSTANCE *hInstance);
86 
87 HRESULT
88 WINAPI
89 FilterInstanceClose(
90     _In_ HFILTER_INSTANCE hInstance);
91 
92 _Must_inspect_result_
93 HRESULT
94 WINAPI
95 FilterAttach(
96     _In_ LPCWSTR lpFilterName,
97     _In_ LPCWSTR lpVolumeName,
98     _In_opt_ LPCWSTR lpInstanceName ,
99     _In_opt_ DWORD dwCreatedInstanceNameLength ,
100     _Out_writes_bytes_opt_(dwCreatedInstanceNameLength) LPWSTR lpCreatedInstanceName);
101 
102 _Must_inspect_result_
103 HRESULT
104 WINAPI
105 FilterAttachAtAltitude(
106     _In_ LPCWSTR lpFilterName,
107     _In_ LPCWSTR lpVolumeName,
108     _In_ LPCWSTR lpAltitude,
109     _In_opt_ LPCWSTR lpInstanceName ,
110     _In_opt_ DWORD dwCreatedInstanceNameLength ,
111     _Out_writes_bytes_opt_(dwCreatedInstanceNameLength) LPWSTR lpCreatedInstanceName);
112 
113 _Must_inspect_result_
114 HRESULT
115 WINAPI
116 FilterDetach(
117     _In_ LPCWSTR lpFilterName,
118     _In_ LPCWSTR lpVolumeName,
119     _In_opt_ LPCWSTR lpInstanceName);
120 
121 _Must_inspect_result_
122 HRESULT
123 WINAPI
124 FilterFindFirst(
125     _In_ FILTER_INFORMATION_CLASS dwInformationClass,
126     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
127     _In_ DWORD dwBufferSize,
128     _Out_ LPDWORD lpBytesReturned,
129     _Out_ LPHANDLE lpFilterFind);
130 
131 _Must_inspect_result_
132 HRESULT
133 WINAPI
134 FilterFindNext(
135     _In_ HANDLE hFilterFind,
136     _In_ FILTER_INFORMATION_CLASS dwInformationClass,
137     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
138     _In_ DWORD dwBufferSize,
139     _Out_ LPDWORD lpBytesReturned);
140 
141 _Must_inspect_result_
142 HRESULT
143 WINAPI
144 FilterFindClose(
145     _In_ HANDLE hFilterFind);
146 
147 _Must_inspect_result_
148 HRESULT
149 WINAPI
150 FilterVolumeFindFirst(
151     _In_ FILTER_VOLUME_INFORMATION_CLASS dwInformationClass,
152     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
153     _In_ DWORD dwBufferSize,
154     _Out_ LPDWORD lpBytesReturned,
155     _Out_ PHANDLE lpVolumeFind);
156 
157 _Must_inspect_result_
158 HRESULT
159 WINAPI
160 FilterVolumeFindNext(
161     _In_ HANDLE hVolumeFind,
162     _In_ FILTER_VOLUME_INFORMATION_CLASS dwInformationClass,
163     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
164     _In_ DWORD dwBufferSize,
165     _Out_ LPDWORD lpBytesReturned);
166 
167 HRESULT
168 WINAPI
169 FilterVolumeFindClose(
170     _In_ HANDLE hVolumeFind);
171 
172 _Must_inspect_result_
173 HRESULT
174 WINAPI
175 FilterInstanceFindFirst(
176     _In_ LPCWSTR lpFilterName,
177     _In_ INSTANCE_INFORMATION_CLASS dwInformationClass,
178     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
179     _In_ DWORD dwBufferSize,
180     _Out_ LPDWORD lpBytesReturned,
181     _Out_ LPHANDLE lpFilterInstanceFind);
182 
183 _Must_inspect_result_
184 HRESULT
185 WINAPI
186 FilterInstanceFindNext(
187     _In_ HANDLE hFilterInstanceFind,
188     _In_ INSTANCE_INFORMATION_CLASS dwInformationClass,
189     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
190     _In_ DWORD dwBufferSize,
191     _Out_ LPDWORD lpBytesReturned);
192 
193 _Must_inspect_result_
194 HRESULT
195 WINAPI
196 FilterInstanceFindClose(
197     _In_ HANDLE hFilterInstanceFind);
198 
199 _Must_inspect_result_
200 HRESULT
201 WINAPI
202 FilterVolumeInstanceFindFirst(
203     _In_ LPCWSTR lpVolumeName,
204     _In_ INSTANCE_INFORMATION_CLASS dwInformationClass,
205     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
206     _In_ DWORD dwBufferSize,
207     _Out_ LPDWORD lpBytesReturned,
208     _Out_ LPHANDLE lpVolumeInstanceFind);
209 
210 _Must_inspect_result_
211 HRESULT
212 WINAPI
213 FilterVolumeInstanceFindNext(
214     _In_ HANDLE hVolumeInstanceFind,
215     _In_ INSTANCE_INFORMATION_CLASS dwInformationClass,
216     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
217     _In_ DWORD dwBufferSize,
218     _Out_ LPDWORD lpBytesReturned);
219 
220 HRESULT
221 WINAPI
222 FilterVolumeInstanceFindClose(
223     _In_ HANDLE hVolumeInstanceFind);
224 
225 _Must_inspect_result_
226 HRESULT
227 WINAPI
228 FilterGetInformation(
229     _In_ HFILTER hFilter,
230     _In_ FILTER_INFORMATION_CLASS dwInformationClass,
231     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
232     _In_ DWORD dwBufferSize,
233     _Out_ LPDWORD lpBytesReturned);
234 
235 _Must_inspect_result_
236 HRESULT
237 WINAPI
238 FilterInstanceGetInformation(
239     _In_ HFILTER_INSTANCE hInstance,
240     _In_ INSTANCE_INFORMATION_CLASS dwInformationClass,
241     _Out_writes_bytes_to_(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer,
242     _In_ DWORD dwBufferSize,
243     _Out_ LPDWORD lpBytesReturned);
244 
245 _Must_inspect_result_
246 HRESULT
247 WINAPI
248 FilterConnectCommunicationPort(
249     _In_ LPCWSTR lpPortName,
250     _In_ DWORD dwOptions,
251     _In_reads_bytes_opt_(wSizeOfContext) LPCVOID lpContext,
252     _In_ WORD wSizeOfContext,
253     _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes ,
254     _Outptr_ HANDLE *hPort);
255 
256 _Must_inspect_result_
257 HRESULT
258 WINAPI
259 FilterSendMessage(
260     _In_ HANDLE hPort,
261     _In_reads_bytes_opt_(dwInBufferSize) LPVOID lpInBuffer,
262     _In_ DWORD dwInBufferSize,
263     _Out_writes_bytes_to_opt_(dwOutBufferSize,*lpBytesReturned) LPVOID lpOutBuffer,
264     _In_ DWORD dwOutBufferSize,
265     _Out_ LPDWORD lpBytesReturned);
266 
267 _Must_inspect_result_
268 HRESULT
269 WINAPI
270 FilterGetMessage(
271     _In_ HANDLE hPort,
272     _Out_writes_bytes_(dwMessageBufferSize) PFILTER_MESSAGE_HEADER lpMessageBuffer,
273     _In_ DWORD dwMessageBufferSize,
274     _Inout_ LPOVERLAPPED lpOverlapped);
275 
276 _Must_inspect_result_
277 HRESULT
278 WINAPI
279 FilterReplyMessage(
280     _In_ HANDLE hPort,
281     _In_reads_bytes_(dwReplyBufferSize) PFILTER_REPLY_HEADER lpReplyBuffer,
282     _In_ DWORD dwReplyBufferSize);
283 
284 _Must_inspect_result_
285 HRESULT
286 WINAPI
287 FilterGetDosName(
288     _In_ LPCWSTR lpVolumeName,
289     _Out_writes_(dwDosNameBufferSize) LPWSTR lpDosName,
290     _In_ DWORD dwDosNameBufferSize);
291 
292 #endif /* FLT_MGR_BASELINE */
293 
294 #ifdef __cplusplus
295 } /* extern "C" */
296 #endif
297 
298 #endif /* __FLTUSER_H__ */
299