1 /* $Id: util.c,v 1.1 1999/08/20 16:29:22 ea Exp $
3 * reactos/ntoskrnl/fs/util.c
9 /**********************************************************************
11 * FsRtlIsTotalDeviceFailure@4
14 * Check if an NTSTATUS error code represents a
15 * disk hardware failure.
22 * FALSE if either (NtStatus >= STATUS_SUCCESS),
23 * STATUS_CRC_ERROR, 0xC000009C; TRUE otherwise.
26 * By calling the function with all possible values,
27 * one unknown NTSTATUS value makes the function
28 * return TRUE (0xC000009C).
32 FsRtlIsTotalDeviceFailure (
37 (NT_SUCCESS(NtStatus
))
38 || (STATUS_CRC_ERROR
== NtStatus
)
39 || (STATUS_UNKNOWN_C000009C
== NtStatus
) /* FIXME */
46 /**********************************************************************
48 * FsRtlIsNtstatusExpected@4
51 * Check an NTSTATUS value is expected by the FS kernel
59 * TRUE if NtStatus is either STATUS_ACCESS_VIOLATION,
60 * STATUS_ILLEGAL_INSTRUCTION, 0x80000002, 0xC00000AA;
64 * By calling the function with all possible values,
65 * two unknown NTSTATUS values make the function
66 * return 0x00 (0x80000002, 0xC00000AA).
70 FsRtlIsNtstatusExpected (
75 (STATUS_UNKNOWN_80000002
== NtStatus
) /* FIXME */
76 || (STATUS_ACCESS_VIOLATION
== NtStatus
)
77 || (STATUS_ILLEGAL_INSTRUCTION
== NtStatus
)
78 || (STATUS_UNKNOWN_C00000AA
== NtStatus
) /* FIXME */
85 /**********************************************************************
87 * FsRtlNormalizeNtstatus@8
90 * Normalize an NTSTATUS value for using in the FS subsystem.
94 * NTSTATUS to normalize.
96 * NTSTATUS to return if the NtStatusToNormalize
97 * value is unexpected by the FS kernel subsystem.
100 * NtStatusToNormalize if it is an expected value,
101 * otherwise NormalizedNtStatus.
105 FsRtlNormalizeNtstatus (
106 NTSTATUS NtStatusToNormalize
,
107 NTSTATUS NormalizedNtStatus
111 (TRUE
== FsRtlIsNtstatusExpected(NtStatusToNormalize
))
112 ? NtStatusToNormalize
113 : NormalizedNtStatus
;