ReactOS 0.4.16-dev-319-g6cf4263
filter.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/fsrtl/filter.c
5 * PURPOSE: Provides support for usage of SEH inside File System Drivers
6 * PROGRAMMERS: None.
7 */
8
9/* INCLUDES ******************************************************************/
10
11#include <ntoskrnl.h>
12#define NDEBUG
13#include <debug.h>
14
15#undef FsRtlAllocatePoolWithQuotaTag
16#undef FsRtlAllocatePoolWithTag
17
18/* PUBLIC FUNCTIONS **********************************************************/
19
20/*++
21 * @name FsRtlIsTotalDeviceFailure
22 * @implemented NT 4.0
23 *
24 * The FsRtlIsTotalDeviceFailure routine checks if an NTSTATUS error code
25 * represents a disk hardware failure.
26 *
27 * @param NtStatus
28 * The NTSTATUS Code to Test
29 *
30 * @return TRUE in case of Hardware Failure, FALSE otherwise.
31 *
32 * @remarks None.
33 *
34 *--*/
38{
39 return((NT_SUCCESS(NtStatus)) ||
40 (STATUS_CRC_ERROR == NtStatus) ||
41 (STATUS_DEVICE_DATA_ERROR == NtStatus) ? FALSE : TRUE);
42}
43
44/*++
45 * @name FsRtlIsNtstatusExpected
46 * @implemented NT 4.0
47 *
48 * The FsRtlIsNtstatusExpected routine checks if an NTSTATUS error code
49 * is expected by the File System Support Library.
50 *
51 * @param NtStatus
52 * The NTSTATUS Code to Test
53 *
54 * @return TRUE if the Value is Expected, FALSE otherwise.
55 *
56 * @remarks None.
57 *
58 *--*/
62{
63 return((STATUS_DATATYPE_MISALIGNMENT == NtStatus) ||
64 (STATUS_ACCESS_VIOLATION == NtStatus) ||
65 (STATUS_ILLEGAL_INSTRUCTION == NtStatus) ||
67}
68
69/*++
70 * @name FsRtlNormalizeNtstatus
71 * @implemented NT 4.0
72 *
73 * The FsRtlNormalizeNtstatus routine normalizes an NTSTATUS error code.
74 *
75 * @param NtStatusToNormalize
76 * The NTSTATUS error code to Normalize.
77 *
78 * @param NormalizedNtStatus
79 * The NTSTATUS error code to return if the NtStatusToNormalize is not
80 * a proper expected error code by the File System Library.
81 *
82 * @return NtStatusToNormalize if it is an expected value, otherwise
83 * NormalizedNtStatus.
84 *
85 * @remarks None.
86 *
87 *--*/
91 IN NTSTATUS NormalizedNtStatus)
92{
93 return(TRUE == FsRtlIsNtstatusExpected(NtStatusToNormalize)) ?
94 NtStatusToNormalize : NormalizedNtStatus;
95}
96
97/*++
98 * @name FsRtlAllocatePool
99 * @implemented
100 *
101 * FILLME
102 *
103 * @param PoolType
104 * FILLME
105 *
106 * @param NumberOfBytes
107 * FILLME
108 *
109 * @return None
110 *
111 * @remarks The pool tag used is "FSrt".
112 *
113 *--*/
114PVOID
115NTAPI
118{
120
124
125 if (NULL == Address)
126 {
128 }
129
130 return Address;
131}
132
133/*++
134 * @name FsRtlAllocatePoolWithQuota
135 * @implemented
136 *
137 * FILLME
138 *
139 * @param PoolType
140 * FILLME
141 *
142 * @param NumberOfBytes
143 * FILLME
144 *
145 * @return None
146 *
147 * @remarks The pool tag used is "FSrt".
148 *
149 *--*/
150PVOID
151NTAPI
154{
156
160 if (NULL == Address)
161 {
163 }
164 return Address;
165}
166
167/*++
168 * @name FsRtlAllocatePoolWithQuotaTag
169 * @implemented
170 *
171 * FILLME
172 *
173 * @param PoolType
174 * FILLME
175 *
176 * @param NumberOfBytes
177 * FILLME
178 *
179 * @param Tag
180 * FILLME
181 *
182 * @return None
183 *
184 * @remarks None
185 *
186 *--*/
187PVOID
188NTAPI
191 IN ULONG Tag)
192{
194
197 Tag);
198
199 if (NULL == Address)
200 {
202 }
203
204 return Address;
205}
206
207/*++
208 * @name FsRtlAllocatePoolWithTag
209 * @implemented
210 *
211 * FILLME
212 *
213 * @param PoolType
214 * FILLME
215 *
216 * @param NumberOfBytes
217 * FILLME
218 *
219 * @param Tag
220 * FILLME
221 *
222 * @return None
223 *
224 * @remarks None
225 *
226 *--*/
227PVOID
228NTAPI
231 IN ULONG Tag)
232{
234
237 Tag);
238
239 if (NULL == Address)
240 {
242 }
243
244 return Address;
245}
246
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_ILLEGAL_INSTRUCTION
Definition: d3dkmdt.h:41
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
BOOLEAN NTAPI FsRtlIsTotalDeviceFailure(IN NTSTATUS NtStatus)
Definition: filter.c:37
PVOID NTAPI FsRtlAllocatePool(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes)
Definition: filter.c:116
PVOID NTAPI FsRtlAllocatePoolWithQuota(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes)
Definition: filter.c:152
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
Definition: filter.c:229
BOOLEAN NTAPI FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
Definition: filter.c:61
NTSTATUS NTAPI FsRtlNormalizeNtstatus(IN NTSTATUS NtStatusToNormalize, IN NTSTATUS NormalizedNtStatus)
Definition: filter.c:90
PVOID NTAPI FsRtlAllocatePoolWithQuotaTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
Definition: filter.c:189
#define ExRaiseStatus
Definition: ntoskrnl.h:114
#define STATUS_INSTRUCTION_MISALIGNMENT
Definition: ntstatus.h:406
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:183
static WCHAR Address[46]
Definition: ping.c:68
#define IFS_POOL_TAG
Definition: tag.h:67
INT POOL_TYPE
Definition: typedefs.h:78
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_CRC_ERROR
Definition: udferr_usr.h:153
#define STATUS_DEVICE_DATA_ERROR
Definition: udferr_usr.h:159
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
#define ExAllocatePoolWithQuotaTag(a, b, c)
Definition: exfuncs.h:530
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036