2 * reactos/apps/lpc/dumpinfo.c
4 * ReactOS Operating System
6 * Dump a kernel object's attributes by its handle.
8 * 19990627 (Emanuele Aliberti)
9 * Initial implementation.
11 * Added code to find the basic information buffer size
12 * for the LPC port object.
19 #include <ddk/ntddk.h>
22 #define MAX_BASIC_INFO_SIZE 512
27 (WINAPI
* QueryObject
)(
28 IN HANDLE ObjectHandle
,
29 IN CINT ObjectInformationClass
,
30 OUT PVOID ObjectInformation
,
32 OUT PULONG ResultLength
37 (WINAPI
* QueryInformationPort
)(
39 IN CINT PortInformationClass
, /* guess */
40 OUT PVOID PortInformation
, /* guess */
41 IN ULONG PortInformationLength
, /* guess */
42 OUT PULONG ReturnLength
/* guess */
57 printf("%s [%d] = ",Name,size);
63 printf("%02X",buffer[i]);
77 BYTE ObjectInformation
[BUF_SIZE
] = {0};
86 printf("\tStatus = %08X\n",Status
);
87 printf("\tPort = %08X\n\n",Port
);
89 * Query object information.
91 printf("Basic Information:\n");
94 ObjectBasicInformation
,
96 sizeof (LPC_PORT_BASIC_INFORMATION
),
99 if (Status
== STATUS_SUCCESS
)
101 PLPC_PORT_BASIC_INFORMATION i
;
103 i
= (PLPC_PORT_BASIC_INFORMATION
) ObjectInformation
;
105 printf( "\tUnknown01 = 0x%08X\n", i
->Unknown0
);
106 printf( "\tUnknown02 = 0x%08X\n", i
->Unknown1
);
107 printf( "\tUnknown03 = 0x%08X\n", i
->Unknown2
);
108 printf( "\tUnknown04 = 0x%08X\n", i
->Unknown3
);
109 printf( "\tUnknown05 = 0x%08X\n", i
->Unknown4
);
110 printf( "\tUnknown06 = 0x%08X\n", i
->Unknown5
);
111 printf( "\tUnknown07 = 0x%08X\n", i
->Unknown6
);
112 printf( "\tUnknown08 = 0x%08X\n", i
->Unknown7
);
113 printf( "\tUnknown09 = 0x%08X\n", i
->Unknown8
);
114 printf( "\tUnknown10 = 0x%08X\n", i
->Unknown9
);
115 printf( "\tUnknown11 = 0x%08X\n", i
->Unknown10
);
116 printf( "\tUnknown12 = 0x%08X\n", i
->Unknown11
);
117 printf( "\tUnknown13 = 0x%08X\n", i
->Unknown12
);
118 printf( "\tUnknown14 = 0x%08X\n", i
->Unknown13
);
122 printf("\tStatus = %08X\n",Status
);
124 printf("Type Information:\n");
125 Status
= QueryObject(
127 ObjectTypeInformation
,
129 sizeof ObjectInformation
,
132 if (Status
== STATUS_SUCCESS
)
134 OBJECT_TYPE_INFORMATION
* i
;
136 i
= (OBJECT_TYPE_INFORMATION
*) ObjectInformation
;
140 (i
->Name
.Length
? i
->Name
.Buffer
: L
"")
143 FIXME: why this always raise an access violation exception?
146 (i->Type.Length ? i->Type.Buffer : L"")
150 "\tTotal Handles: %d\n",
154 "\tReference Count: %d\n",
160 printf("\tStatus = %08X\n",Status
);
162 printf("Name Information:\n");
163 Status
= QueryObject(
165 ObjectNameInformation
,
167 sizeof ObjectInformation
,
170 if (Status
== STATUS_SUCCESS
)
172 OBJECT_NAME_INFORMATION
* i
;
174 i
= (OBJECT_NAME_INFORMATION
*) ObjectInformation
;
177 (i
->Name
.Length
? i
->Name
.Buffer
: L
"")
182 printf("\tStatus = %08X\n",Status
);
184 printf("Data Information:\n");
185 Status
= QueryObject(
187 ObjectDataInformation
,
189 sizeof ObjectInformation
,
192 if (Status
== STATUS_SUCCESS
)
194 OBJECT_DATA_INFORMATION
* i
;
196 i
= (OBJECT_DATA_INFORMATION
*) ObjectInformation
;
198 "\tInherit Handle: %s\n",
199 (i
->bInheritHandle
? "TRUE" : "FALSE")
202 "\tProtect from Close: %s\n",
203 (i
->bProtectFromClose
? "TRUE" : "FALSE")
208 printf("\tStatus = %08X\n",Status
);
211 printf("Port Information:\n");
212 /* Status = QueryInformationPort(
216 sizeof ObjectInformation,
219 if (Status == STATUS_SUCCESS)
221 DWORD * i = ObjectInformation;
224 while (j < ResultLength / sizeof (DWORD))
226 printf("\t%08X\n",i[j]);
232 printf("\tStatus = %08X\n",Status);