// 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;
-/* $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
} 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
LONG Length = 0;
INT Index;
const PCHAR hr =
- "-------- -------- -------- -------- --------\n";
+ "-------- -------- ---- -------- -------- --------\n";
+ CHAR FlagsString [9] = {0};
pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
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;
)
{
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);
"\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"