From 3918e5583d0c41fd8e3695a2a527c71165518547 Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Sun, 28 May 2000 17:44:53 +0000 Subject: [PATCH] Added handle type to object name translation in qsi. svn path=/trunk/; revision=1166 --- rosapps/sysutils/makefile | 7 +++-- rosapps/sysutils/qsi.c | 61 +++++++++++++++++++++++++++++++++++---- rosapps/sysutils/regnav.c | 3 +- 3 files changed, 61 insertions(+), 10 deletions(-) diff --git a/rosapps/sysutils/makefile b/rosapps/sysutils/makefile index 49a81ddae4d..875c11468f9 100644 --- a/rosapps/sysutils/makefile +++ b/rosapps/sysutils/makefile @@ -1,9 +1,9 @@ -# $Id: makefile,v 1.4 2000/04/25 23:22:57 ea Exp $ +# $Id: makefile,v 1.5 2000/05/28 17:44:51 ea Exp $ # # ReactOS System Utilities # # 1999-02-16 (Emanuele Aliberti) -# Added chkdskx.c and formatx.c by by Mark Russinovich +# Added chkdskx.c and formatx.c by Mark Russinovich # (mark@sysinternals.com) and shutdown.c # # 1999-03-03 (Emanuele Aliberti) @@ -27,6 +27,7 @@ ROS_LIB=$(ROS_DIR)/lib IMPORT_NTDLL=$(ROS_LIB)/ntdll/ntdll.a IMPORT_FMIFS=$(ROS_LIB)/fmifs/fmifs.a IMPORT_KERNEL32=$(ROS_LIB)/kernel32/kernel32.a +IMPORT_ADVAPI32=$(ROS_LIB)/advapi32/advapi32.a IMPORT_USER32=$(ROS_LIB)/user32/user32.a IMPORT_CRTDLL=$(ROS_LIB)/crtdll/crtdll.a @@ -82,6 +83,7 @@ regnav.exe: regnav.o win32err.o regnav.o \ win32err.o \ $(IMPORT_KERNEL32) \ + $(IMPORT_ADVAPI32) \ $(IMPORT_CRTDLL) \ -o regnav.exe $(NM) --numeric-sort regnav.exe > regnav.sym @@ -98,7 +100,6 @@ shutdown.exe: shutdown.o win32err.o $(NM) --numeric-sort shutdown.exe > shutdown.sym qsi.exe: qsi.o - echo $(BASE_CFLAGS) $(CC) \ qsi.o \ $(IMPORT_NTDLL) \ diff --git a/rosapps/sysutils/qsi.c b/rosapps/sysutils/qsi.c index ac05c748772..d3ce07a2335 100644 --- a/rosapps/sysutils/qsi.c +++ b/rosapps/sysutils/qsi.c @@ -1,4 +1,4 @@ -/* $Id: qsi.c,v 1.2 2000/04/27 23:39:49 ea Exp $ +/* $Id: qsi.c,v 1.3 2000/05/28 17:44:51 ea Exp $ * * PROJECT : ReactOS Operating System (see http://www.reactos.com/) * DESCRIPTION: Tool to query system information @@ -163,6 +163,55 @@ DumpData (int Size, PVOID pData ) printf ("\n"); } +/* --- */ + +static +LPTSTR +KernelObjectName [] = +{ + _T("0"), /* FIXME */ + _T("1"), /* FIXME */ + _T("Directory"), + _T("SymbolicLink"), + _T("Token"), + _T("Process"), + _T("Thread"), + _T("Event"), + _T("8"), /* FIXME */ + _T("Mutant"), + _T("Semaphore"), + _T("Timer"), + _T("12"), /* FIXME */ + _T("WindowStation"), + _T("Desktop"), + _T("Section"), + _T("Key"), + _T("Port"), + _T("18"), /* FIXME */ + _T("19"), /* FIXME */ + _T("20"), /* FIXME */ + _T("21"), /* FIXME */ + _T("IoCompletion"), + _T("File"), + NULL +}; + + +LPTSTR +STDCALL +HandleTypeToObjectName ( + DWORD HandleType + ) +{ + if (HandleType > 23) /* FIXME: use a symbol not a literal */ + { + return _T("Unknown"); + } + return KernelObjectName [HandleType]; +} + + +/* --- */ int STDCALL @@ -1191,7 +1240,7 @@ CMD_DEF(Handle) LONG Length = 0; INT Index; const PCHAR hr = - "-------- -------- ---- -------- -------- --------\n"; + "-------- -------- -------- -------- -------- ----------\n"; CHAR FlagsString [9] = {0}; pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT); @@ -1245,7 +1294,7 @@ CMD_DEF(Handle) GlobalFree (pInfo); return EXIT_FAILURE; } - printf ("Handle OwnerPID Type ObjPtr Access Flags\n"); + printf ("Handle OwnerPID ObjPtr Access Flags Type\n"); printf (hr); for ( Index = 0; @@ -1254,16 +1303,16 @@ CMD_DEF(Handle) ) { printf ( - "%8x %8x %4d %8x %8x %s\n", + "%8x %8x %8x %8x %s %s\n", pInfo->Handle[Index].HandleValue, pInfo->Handle[Index].OwnerPid, - pInfo->Handle[Index].ObjectType, pInfo->Handle[Index].ObjectPointer, pInfo->Handle[Index].AccessMask, ByteToBinaryString ( pInfo->Handle[Index].HandleFlags, FlagsString - ) + ), + HandleTypeToObjectName (pInfo->Handle[Index].ObjectType) ); } printf (hr); diff --git a/rosapps/sysutils/regnav.c b/rosapps/sysutils/regnav.c index e311172b07c..0b920898d3c 100644 --- a/rosapps/sysutils/regnav.c +++ b/rosapps/sysutils/regnav.c @@ -1,4 +1,4 @@ -/* $Id: regnav.c,v 1.2 1999/05/28 19:49:46 ea Exp $ +/* $Id: regnav.c,v 1.3 2000/05/28 17:44:53 ea Exp $ * * regnav.c * @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include "win32err.h"