From: Emanuele Aliberti Date: Thu, 27 Apr 2000 23:39:49 +0000 (+0000) Subject: A fix in the SYSTEM_HANDLE_INFORMATION structure. X-Git-Tag: backups/prep0016@12448~131 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=537f82fd1a2332c5fae42065bcd8c7cf874297e3 A fix in the SYSTEM_HANDLE_INFORMATION structure. svn path=/trunk/; revision=1139 --- diff --git a/reactos/include/ddk/zwtypes.h b/reactos/include/ddk/zwtypes.h index 7394c42fffb..34b4ccaead1 100644 --- a/reactos/include/ddk/zwtypes.h +++ b/reactos/include/ddk/zwtypes.h @@ -428,11 +428,38 @@ struct _SYSTEM_RESOURCE_LOCK_INFO // UNKNOWN // SystemHandleInformation (16) +#if 0 +#define OBJECT_TYPE_0 0 +#define OBJECT_TYPE_1 1 +#define OBJECT_TYPE_OBJDIRECTORY 2 +#define OBJECT_TYPE_SYMLINK 3 +#define OBJECT_TYPE_TOKEN 4 +#define OBJECT_TYPE_PROCESS 5 +#define OBJECT_TYPE_THREAD 6 +#define OBJECT_TYPE_EVENT 7 +#define OBJECT_TYPE_8 8 +#define OBJECT_TYPE_MUTANT 9 +#define OBJECT_TYPE_SEMAPHORE 10 +#define OBJECT_TYPE_TIMER 11 +#define OBJECT_TYPE_12 12 +#define OBJECT_TYPE_WINSTATION 13 +#define OBJECT_TYPE_DESKTOP 14 +#define OBJECT_TYPE_SECTION 15 +#define OBJECT_TYPE_KEY 16 +#define OBJECT_TYPE_PORT 17 +#define OBJECT_TYPE_18 18 +#define OBJECT_TYPE_19 19 +#define OBJECT_TYPE_20 20 +#define OBJECT_TYPE_21 21 +#define OBJECT_TYPE_IOCOMPLETION 22 +#define OBJECT_TYPE_FILE 23 +#endif typedef struct _SYSTEM_HANDLE_ENTRY { ULONG OwnerPid; - USHORT ObjectType; + BYTE ObjectType; + BYTE HandleFlags; USHORT HandleValue; PVOID ObjectPointer; ULONG AccessMask; diff --git a/rosapps/sysutils/qsi.c b/rosapps/sysutils/qsi.c index fa6989ed57f..ac05c748772 100644 --- a/rosapps/sysutils/qsi.c +++ b/rosapps/sysutils/qsi.c @@ -1,4 +1,4 @@ -/* $Id: qsi.c,v 1.1 2000/04/25 23:22:57 ea Exp $ +/* $Id: qsi.c,v 1.2 2000/04/27 23:39:49 ea Exp $ * * PROJECT : ReactOS Operating System (see http://www.reactos.com/) * DESCRIPTION: Tool to query system information @@ -82,6 +82,26 @@ struct _COMMAND_DESCRIPTOR } COMMAND_DESCRIPTOR, * PCOMMAND_DESCRIPTOR; +/* Fast BYTE to binary representation */ + +#define BIT(n,m) (((n)&(m))?'1':'0') +LPSTR +STDCALL +ByteToBinaryString ( + BYTE Byte, + CHAR Binary [8] + ) +{ + Binary [7] = BIT(Byte,0x01); + Binary [6] = BIT(Byte,0x02); + Binary [5] = BIT(Byte,0x04); + Binary [4] = BIT(Byte,0x08); + Binary [3] = BIT(Byte,0x10); + Binary [2] = BIT(Byte,0x20); + Binary [1] = BIT(Byte,0x40); + Binary [0] = BIT(Byte,0x80); + return (LPSTR) Binary; +} /* --- */ VOID @@ -1171,7 +1191,8 @@ CMD_DEF(Handle) LONG Length = 0; INT Index; const PCHAR hr = - "-------- -------- -------- -------- --------\n"; + "-------- -------- ---- -------- -------- --------\n"; + CHAR FlagsString [9] = {0}; pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT); @@ -1224,7 +1245,7 @@ CMD_DEF(Handle) GlobalFree (pInfo); return EXIT_FAILURE; } - printf ("Handle OwnerPID ObjType ObjPtr Access\n"); + printf ("Handle OwnerPID Type ObjPtr Access Flags\n"); printf (hr); for ( Index = 0; @@ -1233,12 +1254,16 @@ CMD_DEF(Handle) ) { printf ( - "%8x %8x %8x %8x %8x\n", + "%8x %8x %4d %8x %8x %s\n", pInfo->Handle[Index].HandleValue, pInfo->Handle[Index].OwnerPid, pInfo->Handle[Index].ObjectType, pInfo->Handle[Index].ObjectPointer, - pInfo->Handle[Index].AccessMask + pInfo->Handle[Index].AccessMask, + ByteToBinaryString ( + pInfo->Handle[Index].HandleFlags, + FlagsString + ) ); } printf (hr); @@ -2138,7 +2163,7 @@ CMD_DEF(credits) "\tPrasad Dabak, Sandeep Phadke, and Milind Borate\n\n" "Windows NT/2000 Native API Reference:\n" - "\tGary Nebbet\n\n" + "\tGary Nebbett\n\n" "comp.os.ms-windows.programmer.nt.kernel-mode\n" "\t(many postings with sample code)\n"