3 * Convert NTSTATUS codes to Win32 error codes: run it
4 * on a NT box AND on a ROS box, then diff the results.
6 * This utility should help keeping correct how Ros
7 * translates executive's errors codes into Win32 error
10 * Usage: nts2w32err [MaxStatusCode] > log.txt
12 * 2004-01-10 Emanuele Aliberti
20 int main (int argc
, char * argv
[])
22 NTSTATUS Severity
= 0;
23 NTSTATUS StatusCode
= STATUS_SUCCESS
;
24 NTSTATUS Status
= STATUS_SUCCESS
;
25 DWORD LastError
= ERROR_SUCCESS
;
26 DWORD Maximum
= 0x40000;
30 sscanf (argv
[1], "%lx", & Maximum
);
33 printf ("NT error codes 0x0-0x%lx that get translated *not* to ERROR_MR_MID_NOT_FOUND (317)\n\n", Maximum
);
39 printf ("--- Severity %ld ---\n", Severity
);
41 for ( StatusCode
= STATUS_SUCCESS
;
42 StatusCode
<= Maximum
;
45 Status
= ((Severity
<< 30) | StatusCode
);
46 LastError
= RtlNtStatusToDosError (Status
);
47 if (ERROR_MR_MID_NOT_FOUND
!= LastError
)
49 printf ("0x%08lx => %ldL\n", Status
, LastError
);