mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
Little program to report how NT stati are converted into a Win32 error code by NTDLL. Running it under real NT 4.0/5.x and under ROS will show the differences.
svn path=/trunk/; revision=7570
This commit is contained in:
parent
fecf52f44e
commit
0307fd628b
3 changed files with 83 additions and 0 deletions
6
reactos/apps/utils/nts2w32err/.cvsignore
Normal file
6
reactos/apps/utils/nts2w32err/.cvsignore
Normal file
|
@ -0,0 +1,6 @@
|
|||
*.o
|
||||
*.d
|
||||
*.exe
|
||||
*.coff
|
||||
*.sym
|
||||
*.map
|
23
reactos/apps/utils/nts2w32err/makefile
Normal file
23
reactos/apps/utils/nts2w32err/makefile
Normal file
|
@ -0,0 +1,23 @@
|
|||
# $Id: makefile,v 1.1 2004/01/11 17:06:21 ea Exp $
|
||||
|
||||
PATH_TO_TOP = ../../..
|
||||
|
||||
TARGET_NORC = yes
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = nts2w32err
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
TARGET_CFLAGS = -Wall -Werror
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
54
reactos/apps/utils/nts2w32err/nts2w32err.c
Normal file
54
reactos/apps/utils/nts2w32err/nts2w32err.c
Normal file
|
@ -0,0 +1,54 @@
|
|||
/* $Id: nts2w32err.c,v 1.1 2004/01/11 17:06:21 ea Exp $
|
||||
*
|
||||
* Convert NTSTATUS codes to Win32 error codes: run it
|
||||
* on a NT box AND on a ROS box, then diff the results.
|
||||
*
|
||||
* This utility should help keeping correct how Ros
|
||||
* translates executive's errors codes into Win32 error
|
||||
* codes.
|
||||
*
|
||||
* Usage: nts2w32err [MaxStatusCode] > log.txt
|
||||
*
|
||||
* 2004-01-10 Emanuele Aliberti
|
||||
*
|
||||
*/
|
||||
#include <ddk/ntddk.h>
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
NTSTATUS Severity = 0;
|
||||
NTSTATUS StatusCode = STATUS_SUCCESS;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
DWORD LastError = ERROR_SUCCESS;
|
||||
DWORD Maximum = 0x40000;
|
||||
|
||||
if (2 == argc)
|
||||
{
|
||||
sscanf (argv[1], "%lx", & Maximum);
|
||||
}
|
||||
|
||||
printf ("NT error codes 0x0-0x%lx that get translated *not* to ERROR_MR_MID_NOT_FOUND (317)\n\n", Maximum);
|
||||
|
||||
for ( Severity = 0;
|
||||
Severity < 4;
|
||||
Severity ++)
|
||||
{
|
||||
printf ("--- Severity %ld ---\n", Severity);
|
||||
|
||||
for ( StatusCode = STATUS_SUCCESS;
|
||||
StatusCode <= Maximum ;
|
||||
StatusCode ++)
|
||||
{
|
||||
Status = ((Severity << 30) | StatusCode);
|
||||
LastError = RtlNtStatusToDosError (Status);
|
||||
if (ERROR_MR_MID_NOT_FOUND != LastError)
|
||||
{
|
||||
printf ("0x%08lx => %ldL\n", Status, LastError);
|
||||
}
|
||||
}
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
/* EOF */
|
Loading…
Reference in a new issue