00079 :
00080
00081 This routine converts an NT status code to its DOS/OS 2 equivalent
00082 and returns
the translated value.
00083
00084 Arguments:
00085
00086
Status - Supplies
the status value to convert.
00087
00088 Return Value:
00089
00090 The
matching DOS/OS 2 error code.
00091
00092 --*/
00093
00094 {
00095
00096 ULONG
Offset;
00097 ULONG Entry;
00098 ULONG
Index;
00099
00100
00101
00102
00103
00104
00105
00106
if (
Status & 0x20000000) {
00107
00108
00109
00110
00111
00112
00113
return Status;
00114
00115 }
00116
else if ((
Status & 0xffff0000) == 0x80070000) {
00117
00118
00119
00120
00121
00122
return(
Status & 0x0000ffff);
00123 }
00124
else if ((
Status & 0xf0000000) == 0xd0000000) {
00125
00126
00127
00128
00129
00130
Status &= 0xcfffffff;
00131 }
00132
00133
00134
00135
00136
00137
00138 Entry = 0;
00139
Index = 0;
00140
do {
00141
if ((ULONG)
Status >= RtlpRunTable[Entry + 1].BaseCode) {
00142
Index += (RtlpRunTable[Entry].RunLength * RtlpRunTable[Entry].CodeSize);
00143
00144 }
else {
00145
Offset = (ULONG)
Status - RtlpRunTable[Entry].BaseCode;
00146
if (
Offset >= RtlpRunTable[Entry].RunLength) {
00147
break;
00148
00149 }
else {
00150
Index += (
Offset * (ULONG)RtlpRunTable[Entry].CodeSize);
00151
if (RtlpRunTable[Entry].CodeSize == 1) {
00152
return (ULONG)RtlpStatusTable[
Index];
00153
00154 }
else {
00155
return (((ULONG)RtlpStatusTable[
Index + 1] << 16) |
00156 (ULONG)RtlpStatusTable[
Index]);
00157 }
00158 }
00159 }
00160
00161 Entry += 1;
00162 }
while (Entry < (
sizeof(RtlpRunTable) /
sizeof(RUN_ENTRY)));
00163
00164
00165
00166
00167
00168
00169
00170
00171
if (((ULONG)
Status >> 16) == 0xC001) {
00172
return ((ULONG)
Status & 0xFFFF);
00173 }
00174
00175
#ifndef NTOS_KERNEL_RUNTIME
00176
DbgPrint(
"RTL: RtlNtStatusToDosError(0x%lx): No Valid Win32 Error Mapping\n",Status);
00177
DbgPrint(
"RTL: Edit ntos\\rtl\\generr.c to correct the problem\n");
00178
DbgPrint(
"RTL: ERROR_MR_MID_NOT_FOUND is being returned\n");
00179
00180
#if DBG
00181
DbgBreakPoint();
00182
#endif // DBG
00183
00184
#endif // NTOS_KERNEL_RUNTIME
00185
00186
return ERROR_MR_MID_NOT_FOUND;
00187 }
}