3 * reactos/apps/lpc/dumpinfo.c
5 * ReactOS Operating System
7 * Dump a kernel object's attributes by its handle.
9 * 19990627 (Emanuele Aliberti)
10 * Initial implementation.
12 * Added code to find the basic information buffer size
13 * for the LPC port object.
20 #include <ddk/ntddk.h>
23 #define MAX_BASIC_INFO_SIZE 512
28 (STDCALL
* QueryObject
)(
29 IN HANDLE ObjectHandle
,
30 IN CINT ObjectInformationClass
,
31 OUT PVOID ObjectInformation
,
33 OUT PULONG ResultLength
38 (STDCALL
* QueryInformationPort
)(
40 IN CINT PortInformationClass
, /* guess */
41 OUT PVOID PortInformation
, /* guess */
42 IN ULONG PortInformationLength
, /* guess */
43 OUT PULONG ReturnLength
/* guess */
58 printf("%s [%d] = ",Name,size);
64 printf("%02X",buffer[i]);
78 BYTE ObjectInformation
[BUF_SIZE
] = {0};
87 printf("\tStatus = %08X\n",Status
);
88 printf("\tPort = %08X\n\n",Port
);
90 * Query object information.
92 printf("Basic Information:\n");
95 ObjectBasicInformation
,
97 sizeof (LPC_PORT_BASIC_INFORMATION
),
100 if (Status
== STATUS_SUCCESS
)
102 PLPC_PORT_BASIC_INFORMATION i
;
104 i
= (PLPC_PORT_BASIC_INFORMATION
) ObjectInformation
;
106 printf( "\tUnknown01 = 0x%08X\n", i
->Unknown0
);
107 printf( "\tUnknown02 = 0x%08X\n", i
->Unknown1
);
108 printf( "\tUnknown03 = 0x%08X\n", i
->Unknown2
);
109 printf( "\tUnknown04 = 0x%08X\n", i
->Unknown3
);
110 printf( "\tUnknown05 = 0x%08X\n", i
->Unknown4
);
111 printf( "\tUnknown06 = 0x%08X\n", i
->Unknown5
);
112 printf( "\tUnknown07 = 0x%08X\n", i
->Unknown6
);
113 printf( "\tUnknown08 = 0x%08X\n", i
->Unknown7
);
114 printf( "\tUnknown09 = 0x%08X\n", i
->Unknown8
);
115 printf( "\tUnknown10 = 0x%08X\n", i
->Unknown9
);
116 printf( "\tUnknown11 = 0x%08X\n", i
->Unknown10
);
117 printf( "\tUnknown12 = 0x%08X\n", i
->Unknown11
);
118 printf( "\tUnknown13 = 0x%08X\n", i
->Unknown12
);
119 printf( "\tUnknown14 = 0x%08X\n", i
->Unknown13
);
123 printf("\tStatus = %08X\n",Status
);
125 printf("Type Information:\n");
126 Status
= QueryObject(
128 ObjectTypeInformation
,
130 sizeof ObjectInformation
,
133 if (Status
== STATUS_SUCCESS
)
135 OBJECT_TYPE_INFORMATION
* i
;
137 i
= (OBJECT_TYPE_INFORMATION
*) ObjectInformation
;
141 (i
->Name
.Length
? i
->Name
.Buffer
: L
"")
144 FIXME: why this always raise an access violation exception?
147 (i->Type.Length ? i->Type.Buffer : L"")
151 "\tTotal Handles: %d\n",
155 "\tReference Count: %d\n",
161 printf("\tStatus = %08X\n",Status
);
163 printf("Name Information:\n");
164 Status
= QueryObject(
166 ObjectNameInformation
,
168 sizeof ObjectInformation
,
171 if (Status
== STATUS_SUCCESS
)
173 OBJECT_NAME_INFORMATION
* i
;
175 i
= (OBJECT_NAME_INFORMATION
*) ObjectInformation
;
178 (i
->Name
.Length
? i
->Name
.Buffer
: L
"")
183 printf("\tStatus = %08X\n",Status
);
185 printf("Data Information:\n");
186 Status
= QueryObject(
188 ObjectDataInformation
,
190 sizeof ObjectInformation
,
193 if (Status
== STATUS_SUCCESS
)
195 OBJECT_DATA_INFORMATION
* i
;
197 i
= (OBJECT_DATA_INFORMATION
*) ObjectInformation
;
199 "\tInherit Handle: %s\n",
200 (i
->bInheritHandle
? "TRUE" : "FALSE")
203 "\tProtect from Close: %s\n",
204 (i
->bProtectFromClose
? "TRUE" : "FALSE")
209 printf("\tStatus = %08X\n",Status
);
212 printf("Port Information:\n");
213 /* Status = QueryInformationPort(
217 sizeof ObjectInformation,
220 if (Status == STATUS_SUCCESS)
222 DWORD * i = ObjectInformation;
225 while (j < ResultLength / sizeof (DWORD))
227 printf("\t%08X\n",i[j]);
233 printf("\tStatus = %08X\n",Status);