A fix in the SYSTEM_HANDLE_INFORMATION structure.

svn path=/trunk/; revision=1139
This commit is contained in:
Emanuele Aliberti 2000-04-27 23:39:49 +00:00
parent b13b811b5f
commit 537f82fd1a
2 changed files with 59 additions and 7 deletions

View file

@ -428,11 +428,38 @@ struct _SYSTEM_RESOURCE_LOCK_INFO
// UNKNOWN // UNKNOWN
// SystemHandleInformation (16) // 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 typedef
struct _SYSTEM_HANDLE_ENTRY struct _SYSTEM_HANDLE_ENTRY
{ {
ULONG OwnerPid; ULONG OwnerPid;
USHORT ObjectType; BYTE ObjectType;
BYTE HandleFlags;
USHORT HandleValue; USHORT HandleValue;
PVOID ObjectPointer; PVOID ObjectPointer;
ULONG AccessMask; ULONG AccessMask;

View file

@ -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/) * PROJECT : ReactOS Operating System (see http://www.reactos.com/)
* DESCRIPTION: Tool to query system information * DESCRIPTION: Tool to query system information
@ -82,6 +82,26 @@ struct _COMMAND_DESCRIPTOR
} COMMAND_DESCRIPTOR, * PCOMMAND_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 VOID
@ -1171,7 +1191,8 @@ CMD_DEF(Handle)
LONG Length = 0; LONG Length = 0;
INT Index; INT Index;
const PCHAR hr = const PCHAR hr =
"-------- -------- -------- -------- --------\n"; "-------- -------- ---- -------- -------- --------\n";
CHAR FlagsString [9] = {0};
pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT); pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
@ -1224,7 +1245,7 @@ CMD_DEF(Handle)
GlobalFree (pInfo); GlobalFree (pInfo);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
printf ("Handle OwnerPID ObjType ObjPtr Access\n"); printf ("Handle OwnerPID Type ObjPtr Access Flags\n");
printf (hr); printf (hr);
for ( Index = 0; for ( Index = 0;
@ -1233,12 +1254,16 @@ CMD_DEF(Handle)
) )
{ {
printf ( printf (
"%8x %8x %8x %8x %8x\n", "%8x %8x %4d %8x %8x %s\n",
pInfo->Handle[Index].HandleValue, pInfo->Handle[Index].HandleValue,
pInfo->Handle[Index].OwnerPid, pInfo->Handle[Index].OwnerPid,
pInfo->Handle[Index].ObjectType, pInfo->Handle[Index].ObjectType,
pInfo->Handle[Index].ObjectPointer, pInfo->Handle[Index].ObjectPointer,
pInfo->Handle[Index].AccessMask pInfo->Handle[Index].AccessMask,
ByteToBinaryString (
pInfo->Handle[Index].HandleFlags,
FlagsString
)
); );
} }
printf (hr); printf (hr);
@ -2138,7 +2163,7 @@ CMD_DEF(credits)
"\tPrasad Dabak, Sandeep Phadke, and Milind Borate\n\n" "\tPrasad Dabak, Sandeep Phadke, and Milind Borate\n\n"
"Windows NT/2000 Native API Reference:\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" "comp.os.ms-windows.programmer.nt.kernel-mode\n"
"\t(many postings with sample code)\n" "\t(many postings with sample code)\n"