Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenfilter.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS Kernel 00003 * LICENSE: GPL - See COPYING in the top level directory 00004 * FILE: ntoskrnl/fsrtl/filter.c 00005 * PURPOSE: Provides support for usage of SEH inside File System Drivers 00006 * PROGRAMMERS: None. 00007 */ 00008 00009 /* INCLUDES ******************************************************************/ 00010 00011 #include <ntoskrnl.h> 00012 #define NDEBUG 00013 #include <debug.h> 00014 00015 #undef FsRtlAllocatePoolWithQuotaTag 00016 #undef FsRtlAllocatePoolWithTag 00017 00018 /* PUBLIC FUNCTIONS **********************************************************/ 00019 00020 /*++ 00021 * @name FsRtlIsTotalDeviceFailure 00022 * @implemented NT 4.0 00023 * 00024 * The FsRtlIsTotalDeviceFailure routine checks if an NTSTATUS error code 00025 * represents a disk hardware failure. 00026 * 00027 * @param NtStatus 00028 * The NTSTATUS Code to Test 00029 * 00030 * @return TRUE in case of Hardware Failure, FALSE otherwise. 00031 * 00032 * @remarks None. 00033 * 00034 *--*/ 00035 BOOLEAN 00036 NTAPI 00037 FsRtlIsTotalDeviceFailure(IN NTSTATUS NtStatus) 00038 { 00039 return((NT_SUCCESS(NtStatus)) || 00040 (STATUS_CRC_ERROR == NtStatus) || 00041 (STATUS_DEVICE_DATA_ERROR == NtStatus) ? FALSE : TRUE); 00042 } 00043 00044 /*++ 00045 * @name FsRtlIsNtstatusExpected 00046 * @implemented NT 4.0 00047 * 00048 * The FsRtlIsNtstatusExpected routine checks if an NTSTATUS error code 00049 * is expected by the File System Support Library. 00050 * 00051 * @param NtStatus 00052 * The NTSTATUS Code to Test 00053 * 00054 * @return TRUE if the Value is Expected, FALSE otherwise. 00055 * 00056 * @remarks None. 00057 * 00058 *--*/ 00059 BOOLEAN 00060 NTAPI 00061 FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus) 00062 { 00063 return((STATUS_DATATYPE_MISALIGNMENT == NtStatus) || 00064 (STATUS_ACCESS_VIOLATION == NtStatus) || 00065 (STATUS_ILLEGAL_INSTRUCTION == NtStatus) || 00066 (STATUS_INSTRUCTION_MISALIGNMENT == NtStatus)) ? FALSE : TRUE; 00067 } 00068 00069 /*++ 00070 * @name FsRtlNormalizeNtstatus 00071 * @implemented NT 4.0 00072 * 00073 * The FsRtlNormalizeNtstatus routine normalizes an NTSTATUS error code. 00074 * 00075 * @param NtStatusToNormalize 00076 * The NTSTATUS error code to Normalize. 00077 * 00078 * @param NormalizedNtStatus 00079 * The NTSTATUS error code to return if the NtStatusToNormalize is not 00080 * a proper expected error code by the File System Library. 00081 * 00082 * @return NtStatusToNormalize if it is an expected value, otherwise 00083 * NormalizedNtStatus. 00084 * 00085 * @remarks None. 00086 * 00087 *--*/ 00088 NTSTATUS 00089 NTAPI 00090 FsRtlNormalizeNtstatus(IN NTSTATUS NtStatusToNormalize, 00091 IN NTSTATUS NormalizedNtStatus) 00092 { 00093 return(TRUE == FsRtlIsNtstatusExpected(NtStatusToNormalize)) ? 00094 NtStatusToNormalize : NormalizedNtStatus; 00095 } 00096 00097 /*++ 00098 * @name FsRtlAllocatePool 00099 * @implemented 00100 * 00101 * FILLME 00102 * 00103 * @param PoolType 00104 * FILLME 00105 * 00106 * @param NumberOfBytes 00107 * FILLME 00108 * 00109 * @return None 00110 * 00111 * @remarks The pool tag used is "FSrt". 00112 * 00113 *--*/ 00114 PVOID 00115 NTAPI 00116 FsRtlAllocatePool(IN POOL_TYPE PoolType, 00117 IN ULONG NumberOfBytes) 00118 { 00119 PVOID Address; 00120 00121 Address = ExAllocatePoolWithTag(PoolType, 00122 NumberOfBytes, 00123 IFS_POOL_TAG); 00124 00125 if (NULL == Address) 00126 { 00127 ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES); 00128 } 00129 00130 return Address; 00131 } 00132 00133 /*++ 00134 * @name FsRtlAllocatePoolWithQuota 00135 * @implemented 00136 * 00137 * FILLME 00138 * 00139 * @param PoolType 00140 * FILLME 00141 * 00142 * @param NumberOfBytes 00143 * FILLME 00144 * 00145 * @return None 00146 * 00147 * @remarks The pool tag used is "FSrt". 00148 * 00149 *--*/ 00150 PVOID 00151 NTAPI 00152 FsRtlAllocatePoolWithQuota(IN POOL_TYPE PoolType, 00153 IN ULONG NumberOfBytes) 00154 { 00155 PVOID Address; 00156 00157 Address = ExAllocatePoolWithQuotaTag(PoolType, 00158 NumberOfBytes, 00159 IFS_POOL_TAG); 00160 if (NULL == Address) 00161 { 00162 ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES); 00163 } 00164 return Address; 00165 } 00166 00167 /*++ 00168 * @name FsRtlAllocatePoolWithQuotaTag 00169 * @implemented 00170 * 00171 * FILLME 00172 * 00173 * @param PoolType 00174 * FILLME 00175 * 00176 * @param NumberOfBytes 00177 * FILLME 00178 * 00179 * @param Tag 00180 * FILLME 00181 * 00182 * @return None 00183 * 00184 * @remarks None 00185 * 00186 *--*/ 00187 PVOID 00188 NTAPI 00189 FsRtlAllocatePoolWithQuotaTag (IN POOL_TYPE PoolType, 00190 IN ULONG NumberOfBytes, 00191 IN ULONG Tag) 00192 { 00193 PVOID Address; 00194 00195 Address = ExAllocatePoolWithQuotaTag(PoolType, 00196 NumberOfBytes, 00197 Tag); 00198 00199 if (NULL == Address) 00200 { 00201 ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES); 00202 } 00203 00204 return Address; 00205 } 00206 00207 /*++ 00208 * @name FsRtlAllocatePoolWithTag 00209 * @implemented 00210 * 00211 * FILLME 00212 * 00213 * @param PoolType 00214 * FILLME 00215 * 00216 * @param NumberOfBytes 00217 * FILLME 00218 * 00219 * @param Tag 00220 * FILLME 00221 * 00222 * @return None 00223 * 00224 * @remarks None 00225 * 00226 *--*/ 00227 PVOID 00228 NTAPI 00229 FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, 00230 IN ULONG NumberOfBytes, 00231 IN ULONG Tag) 00232 { 00233 PVOID Address; 00234 00235 Address = ExAllocatePoolWithTag(PoolType, 00236 NumberOfBytes, 00237 Tag); 00238 00239 if (NULL == Address) 00240 { 00241 ExRaiseStatus(STATUS_INSUFFICIENT_RESOURCES); 00242 } 00243 00244 return Address; 00245 } 00246 Generated on Sun May 27 2012 04:24:45 for ReactOS by
1.7.6.1
|