ReactOS 0.4.17-dev-475-g46e69e6
ObTypes.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite Object types test
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8#include <kmt_test.h>
9#include "ObTypes.hpp"
10
11#define NDEBUG
12#include <debug.h>
13
14const UCHAR TypeIndex_Type[] = { 1, 1 };
15const UCHAR TypeIndex_Directory[] = { 2, 2 };
16const UCHAR TypeIndex_SymbolicLink[] = { 3, 3 };
17const UCHAR TypeIndex_Token[] = { 4, 4 };
18const UCHAR TypeIndex_Process[] = { 5, 6 };
19const UCHAR TypeIndex_Thread[] = { 6, 7 };
20const UCHAR TypeIndex_Job[] = { 7, 5 };
21const UCHAR TypeIndex_DebugObject[] = { 8, 8 };
22const UCHAR TypeIndex_Event[] = { 9, 9 };
23const UCHAR TypeIndex_EventPair[] = { 10, 10 };
24const UCHAR TypeIndex_Mutant[] = { 11, 11 };
25const UCHAR TypeIndex_Callback[] = { 12, 12 };
26const UCHAR TypeIndex_Semaphore[] = { 13, 13 };
27const UCHAR TypeIndex_Timer[] = { 14, 14 };
28const UCHAR TypeIndex_Profile[] = { 15, 15 };
29const UCHAR TypeIndex_KeyedEvent[] = { 16, 16 };
30const UCHAR TypeIndex_WindowStation[] = { 17, 17 };
31const UCHAR TypeIndex_Desktop[] = { 18, 18 };
32const UCHAR TypeIndex_Section[] = { 19, 30 };
33const UCHAR TypeIndex_Key[] = { 20, 32 };
34const UCHAR TypeIndex_Port[] = { 21, 21 };
35const UCHAR TypeIndex_WaitablePort[] = { 22, 22 };
36const UCHAR TypeIndex_Adapter[] = { 23, 20 };
37const UCHAR TypeIndex_Controller[] = { 24, 21 };
38const UCHAR TypeIndex_Device[] = { 25, 22 };
39const UCHAR TypeIndex_Driver[] = { 26, 23 };
40const UCHAR TypeIndex_IoCompletion[] = { 27, 24 };
41const UCHAR TypeIndex_File[] = { 28, 25 };
42const UCHAR TypeIndex_WmiGuid[] = { 29, 34 };
45
46static
48GetNtDdiIndex(ULONG NtDdiVersion)
49{
50 switch (NtDdiVersion)
51 {
52 case NTDDI_WS03: return 0;
53 case NTDDI_VISTA: return 1;
54 case NTDDI_VISTASP1: return 1;
55 case NTDDI_VISTASP2: return 1;
56 case NTDDI_VISTASP3: return 1;
57 default:
58 trace("Unsupported NTDDI version 0x%lx\n", NtDdiVersion);
59 return 0;
60 }
61}
62
63#define GetTypeIndex(TypeName, NtDdiVersion) \
64 (TypeIndex_ ## TypeName[GetNtDdiIndex(NtDdiVersion)])
65
66static
69 IN PCWSTR TypeName)
70{
76
77 RtlInitUnicodeString(&Name, TypeName);
80 ok(Status == STATUS_SUCCESS, "ObOpenObjectByName failed for '%wZ': %08x\n", &Name, Status);
81 ok(Handle != NULL, "ObjectTypeHandle = NULL\n");
82 if (!skip(Status == STATUS_SUCCESS && Handle, "No handle\n"))
83 {
85 ok(Status == STATUS_SUCCESS, "ObReferenceObjectByHandle failed for '%wZ': %08x\n", &Name, Status);
86 ok(ObjectType != NULL, "ObjectType = NULL\n");
88 ok(Status == STATUS_SUCCESS, "ZwClose failed for '%wZ': %08x\n", &Name, Status);
89 }
91}
92
93#define ok_eq_ustr(value, expected) ok(RtlEqualUnicodeString(value, expected, FALSE), #value " = \"%wZ\", expected \"%%wZ\"\n", value, expected)
94
95#define CheckObjectType(TypeName, Variable, Flags, InvalidAttr, \
96 ReadMapping, WriteMapping, ExecMapping, AllMapping, \
97 ValidMask) do \
98{ \
99 OBJECT_TYPE* ObjectType; \
100 UNICODE_STRING Name; \
101 ULONG Key; \
102 BOOLEAN UseDefault = ((Flags) & OBT_NO_DEFAULT) == 0; \
103 BOOLEAN CustomSecurityProc = ((Flags) & OBT_CUSTOM_SECURITY_PROC) != 0; \
104 BOOLEAN SecurityRequired = ((Flags) & OBT_SECURITY_REQUIRED) != 0; \
105 BOOLEAN CaseInsensitive = ((Flags) & OBT_CASE_INSENSITIVE) != 0; \
106 BOOLEAN MaintainTypeList = ((Flags) & OBT_MAINTAIN_TYPE_LIST) != 0; \
107 BOOLEAN MaintainHandleCount = ((Flags) & OBT_MAINTAIN_HANDLE_COUNT) != 0; \
108 POOL_TYPE PoolType = ((Flags) & OBT_PAGED_POOL) ? PagedPool : NonPagedPool; \
109 BOOLEAN CustomKey = ((Flags) & OBT_CUSTOM_KEY) != 0; \
110 ULONG Index = GetTypeIndex(TypeName, NtDdiVersion); \
111 \
112 trace(#TypeName "\n"); \
113 ObjectType = (OBJECT_TYPE*)GetObjectType(L"\\ObjectTypes\\" L ## #TypeName); \
114 ok(ObjectType != NULL, "ObjectType = NULL\n"); \
115 if (!skip(ObjectType != NULL, "No ObjectType\n")) \
116 { \
117 ok(!Variable || (OBJECT_TYPE*)Variable == (OBJECT_TYPE*)ObjectType, \
118 #Variable "is %p, expected %p\n", Variable, ObjectType); \
119 RtlInitUnicodeString(&Name, L ## #TypeName); \
120 ok_eq_ustr(&ObjectType->Name, &Name); \
121 ok_eq_ulong(ObjectType->Index, Index); \
122 /* apparently, File and WaitablePort are evil and have other stuff \
123 * in DefaultObject. All others are NULL */ \
124 if (UseDefault) \
125 ok_eq_pointer(ObjectType->DefaultObject, ObpDefaultObject); \
126 /*ok(ObjectType->TotalNumberOfObjects >= 1, \
127 "Number of objects = %lu\n", ObjectType->TotalNumberOfObjects); \
128 ok(ObjectType->TotalNumberOfHandles >= ObjectType->TotalNumberOfObjects, \
129 "%lu objects, but %lu handles\n", \
130 ObjectType->TotalNumberOfObjects, ObjectType->TotalNumberOfHandles);*/ \
131 ok(ObjectType->HighWaterNumberOfObjects >= ObjectType->TotalNumberOfObjects,\
132 "%lu objects, but high water %lu\n", \
133 ObjectType->TotalNumberOfObjects, ObjectType->HighWaterNumberOfObjects); \
134 ok(ObjectType->HighWaterNumberOfHandles >= ObjectType->TotalNumberOfHandles,\
135 "%lu handles, but high water %lu\n", \
136 ObjectType->TotalNumberOfHandles, ObjectType->HighWaterNumberOfHandles); \
137 ok_eq_ulong(ObjectType->TypeInfo.Length, sizeof(OBJECT_TYPE_INITIALIZER)); \
138 ok_eq_bool(ObjectType->TypeInfo.UseDefaultObject, UseDefault); \
139 ok_eq_bool(ObjectType->TypeInfo.CaseInsensitive, CaseInsensitive); \
140 ok_eq_hex(ObjectType->TypeInfo.InvalidAttributes, InvalidAttr); \
141 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericRead, ReadMapping); \
142 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericWrite, WriteMapping); \
143 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericExecute, ExecMapping); \
144 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericAll, AllMapping); \
145 ok_eq_hex(ObjectType->TypeInfo.ValidAccessMask, ValidMask); \
146 ok_eq_bool(ObjectType->TypeInfo.SecurityRequired, SecurityRequired); \
147 ok_eq_bool(ObjectType->TypeInfo.MaintainHandleCount, MaintainHandleCount); \
148 ok_eq_bool(ObjectType->TypeInfo.MaintainTypeList, MaintainTypeList); \
149 ok_eq_ulong(ObjectType->TypeInfo.PoolType, PoolType); \
150 /* DefaultPagedPoolCharge */ \
151 /* DefaultNonPagedPoolCharge */ \
152 /* DumpProcedure */ \
153 /* OpenProcedure */ \
154 /* CloseProcedure */ \
155 /* DeleteProcedure */ \
156 /* ParseProcedure */ \
157 if (CustomSecurityProc) \
158 ok(ObjectType->TypeInfo.SecurityProcedure != NULL, \
159 "No Security Proc\n"); \
160 else \
161 ok_eq_pointer(ObjectType->TypeInfo.SecurityProcedure, \
162 SeDefaultObjectMethod); \
163 /* QueryNameProcedure */ \
164 /* OkayToCloseProcedure */ \
165 Key = *(PULONG)#TypeName; \
166 if (sizeof(#TypeName) <= 4) Key |= ' ' << 24; \
167 if (sizeof(#TypeName) <= 3) Key |= ' ' << 16; \
168 if (sizeof(#TypeName) <= 2) Key |= ' ' << 8; \
169 if (!CustomKey) \
170 ok_eq_hex(ObjectType->Key, Key); \
171 ObDereferenceObject(ObjectType); \
172 } \
173} while (0)
175#define ObpDirectoryObjectType NULL
176#define ObpSymbolicLinkObjectType NULL
177#define DbgkDebugObjectType NULL
178#define ExEventPairObjectType NULL
179#define ExMutantObjectType NULL
180#define ExCallbackObjectType NULL
181#define ExTimerObjectType NULL
182#define ExProfileObjectType NULL
183#define ExpKeyedEventObjectType NULL
184#define CmpKeyObjectType NULL
185#define LpcWaitablePortObjectType NULL
186#define IoControllerObjectType NULL
187#define IoCompletionObjectType NULL
188#define WmipGuidObjectType NULL
190#define OBT_NO_DEFAULT 0x01
191#define OBT_CUSTOM_SECURITY_PROC 0x02
192#define OBT_SECURITY_REQUIRED 0x04
193#define OBT_CASE_INSENSITIVE 0x08
194#define OBT_MAINTAIN_TYPE_LIST 0x10
195#define OBT_MAINTAIN_HANDLE_COUNT 0x20
196#define OBT_PAGED_POOL 0x40
197#define OBT_CUSTOM_KEY 0x80
198
199#define TAG(x) RtlUlongByteSwap(x)
200
201template<unsigned NtDdiVersion>
202static
203VOID
205{
211
212 ObpTypeObjectType = (OBJECT_TYPE*)GetObjectType(L"\\ObjectTypes\\Type");
213 if (skip(ObpTypeObjectType != NULL, "No Type object type\n"))
214 return;
215
217 ok(ObpDefaultObject != NULL, "No ObpDefaultObject\n");
219 ok(SeDefaultObjectMethod != NULL, "No SeDefaultObjectMethod\n");
220
221#ifdef _PROPER_NT_NDK_EXPORTS
222#define ObpTypeObjectType *ObpTypeObjectType
223#define ObpDirectoryObjectType *ObpDirectoryObjectType
224#define ObpSymbolicLinkObjectType *ObpSymbolicLinkObjectType
225#define PsJobType *PsJobType
226#define DbgkDebugObjectType *DbgkDebugObjectType
227#define ExEventPairObjectType *ExEventPairObjectType
228#define ExMutantObjectType *ExMutantObjectType
229#define ExCallbackObjectType *ExCallbackObjectType
230#define ExTimerObjectType *ExTimerObjectType
231#define ExProfileObjectType *ExProfileObjectType
232#define ExpKeyedEventObjectType *ExpKeyedEventObjectType
233#define ExWindowStationObjectType *ExWindowStationObjectType
234#define ExDesktopObjectType *ExDesktopObjectType
235#define MmSectionObjectType *MmSectionObjectType
236#define CmpKeyObjectType *CmpKeyObjectType
237#define LpcPortObjectType *LpcPortObjectType
238#define LpcWaitablePortObjectType *LpcWaitablePortObjectType
239#define IoAdapterObjectType *IoAdapterObjectType
240#define IoControllerObjectType *IoControllerObjectType
241#define IoDeviceObjectType *IoDeviceObjectType
242#define IoDriverObjectType *IoDriverObjectType
243#define IoCompletionObjectType *IoCompletionObjectType
244#define WmipGuidObjectType *WmipGuidObjectType
245#endif
246
247#define DIR_SEC_REQUIRED ((NtDdiVersion >= NTDDI_VISTA) ? OBT_SECURITY_REQUIRED : 0)
248#define TOKEN_GENERIC_READ ((NtDdiVersion >= NTDDI_VISTA) ? 0x02001a : 0x020008)
249#define TOKEN_GENERIC_WRITE ((NtDdiVersion >= NTDDI_VISTA) ? 0x0201e0 : 0x0200e0)
250#define TOKEN_GENERIC_EXECUTE ((NtDdiVersion >= NTDDI_VISTA) ? 0x020005 : 0x020000)
251#define PROCESS_GENERIC_WRITE ((NtDdiVersion >= NTDDI_VISTA) ? 0x020bea : 0x020beb)
252#define PROCESS_GENERIC_EXECUTE ((NtDdiVersion >= NTDDI_VISTA) ? 0x121001 : 0x120000)
253#define PROCESS_GENERIC_ALL ((NtDdiVersion >= NTDDI_VISTA) ? 0x001fffff : 0x1f0fff)
254#define THREAD_GENERIC_WRITE ((NtDdiVersion >= NTDDI_VISTA) ? 0x020437 : 0x020037)
255#define THREAD_GENERIC_EXECUTE ((NtDdiVersion >= NTDDI_VISTA) ? 0x120800 : 0x120000)
256#define THREAD_GENERIC_ALL ((NtDdiVersion >= NTDDI_VISTA) ? 0x1fffff : 0x1f03ff)
257#define JOB_GENERIC_ALL ((NtDdiVersion >= NTDDI_VISTA) ? 0x1f001f : 0x1f03ff)
258#define KEY_GENERIC_EXECUTE ((NtDdiVersion >= NTDDI_VISTA) ? 0x020039 : 0x020019)
259#define PROCESS_INDEX ((NtDdiVersion >= NTDDI_VISTA) ? 6 : 5)
260
261 CheckObjectType(Type, ObpTypeObjectType, OBT_MAINTAIN_TYPE_LIST | OBT_CUSTOM_KEY, 0x100, 0x020000, 0x020000, 0x020000, 0x0f0001, 0x1f0001);
263 CheckObjectType(Directory, ObpDirectoryObjectType, DIR_SEC_REQUIRED | OBT_CASE_INSENSITIVE | OBT_PAGED_POOL, 0x100, 0x020003, 0x02000c, 0x020003, 0x0f000f, 0x0f000f);
264 CheckObjectType(SymbolicLink, ObpSymbolicLinkObjectType, OBT_CASE_INSENSITIVE | OBT_PAGED_POOL, 0x100, 0x020001, 0x020000, 0x020001, 0x0f0001, 0x0f0001);
268 CheckObjectType(Job, PsJobType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x000, 0x020004, 0x02000b, 0x120000, JOB_GENERIC_ALL, 0x1f001f);
269 CheckObjectType(DebugObject, DbgkDebugObjectType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x000, 0x020001, 0x020002, 0x120000, 0x1f000f, 0x1f000f);
270 CheckObjectType(Event, *ExEventObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003);
271 CheckObjectType(EventPair, ExEventPairObjectType, 0, 0x100, 0x120000, 0x120000, 0x120000, 0x1f0000, 0x1f0000);
272 CheckObjectType(Mutant, ExMutantObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020000, 0x120000, 0x1f0001, 0x1f0001);
273 CheckObjectType(Callback, ExCallbackObjectType, OBT_NO_DEFAULT, 0x100, 0x020000, 0x020001, 0x120000, 0x1f0001, 0x1f0001);
274 CheckObjectType(Semaphore, *ExSemaphoreObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003);
275 CheckObjectType(Timer, ExTimerObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003);
276 CheckObjectType(Profile, ExProfileObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020001, 0x020001, 0x0f0001, 0x0f0001);
277 CheckObjectType(KeyedEvent, ExpKeyedEventObjectType, OBT_PAGED_POOL, 0x000, 0x020001, 0x020002, 0x020000, 0x0f0003, 0x1f0003);
279 0x130, 0x020303, 0x02001c, 0x020060, 0x0f037f, 0x0f037f);
281 0x130, 0x020041, 0x0200be, 0x020100, 0x0f01ff, 0x0f01ff);
282 CheckObjectType(Section, MmSectionObjectType, OBT_PAGED_POOL, 0x100, 0x020005, 0x020002, 0x020008, 0x0f001f, 0x1f001f);
284 0x030, 0x020019, 0x020006, KEY_GENERIC_EXECUTE, 0x0f003f, 0x1f003f);
285 if (NtDdiVersion <= NTDDI_WS03)
286 {
287 // 0x7b2 is used for Server 2003 SP2 RTM, it seems it was changed to 0xfb2 in some patch level.
288 CheckObjectType(Port, LpcPortObjectType, OBT_PAGED_POOL, 0xfb2, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001);
289 // 0x7b2 is used for Server 2003 SP2 RTM, it seems it was changed to 0xfb2 in some patch level.
290 CheckObjectType(WaitablePort, LpcWaitablePortObjectType, OBT_NO_DEFAULT, 0xfb2, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001);
291 }
292 CheckObjectType(Adapter, IoAdapterObjectType, 0, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
293 CheckObjectType(Controller, IoControllerObjectType, 0, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
295 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
296 CheckObjectType(Driver, IoDriverObjectType, OBT_CASE_INSENSITIVE, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
297 CheckObjectType(IoCompletion, IoCompletionObjectType, OBT_CASE_INSENSITIVE, 0x110, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003);
299 0x130, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
301 0x100, 0x000001, 0x000002, 0x000010, 0x120fff, 0x1f0fff);
302 CheckObjectType(FilterConnectionPort, NULL, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x100, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001);
303 CheckObjectType(FilterCommunicationPort, NULL, OBT_NO_DEFAULT, 0x100, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001);
304
305 // exported but not created
307
308 // my Win7/x64 additionally has:
309 // ALPC Port
310 // EtwConsumer
311 // EtwRegistration
312 // IoCompletionReserve
313 // PcwObject
314 // PowerRequest
315 // Session
316 // TmEn
317 // TmRm
318 // TmTm
319 // TmTx
320 // TpWorkerFactory
321 // UserApcReserve
322 // ... and does not have:
323 // Port
324 // WaitablePort
325
327}
328
329START_TEST(ObTypes)
330{
331 ULONG NtDdiVersion = GetNTDDIVersion();
332
333 switch (NtDdiVersion)
334 {
335 case NTDDI_WS03:
336 TestObjectTypes<NTDDI_WS03>();
337 return;
338 case NTDDI_VISTA:
339 TestObjectTypes<NTDDI_VISTA>();
340 return;
341 case NTDDI_VISTASP1:
342 case NTDDI_VISTASP2:
343 case NTDDI_VISTASP3:
344 TestObjectTypes<NTDDI_VISTASP1>();
345 return;
346 case NTDDI_WIN7:
347 TestObjectTypes<NTDDI_WIN7>();
348 return;
349 default:
350 skip(FALSE, "Unsupported NTDDI version: 0x%lx\n", NtDdiVersion);
351 return;
352 }
353}
const UCHAR TypeIndex_Semaphore[]
Definition: ObTypes.cpp:26
#define ObpDirectoryObjectType
Definition: ObTypes.cpp:170
const UCHAR TypeIndex_Section[]
Definition: ObTypes.cpp:32
#define KEY_GENERIC_EXECUTE
static ULONG GetNtDdiIndex(ULONG NtDdiVersion)
Definition: ObTypes.cpp:48
#define TOKEN_GENERIC_EXECUTE
#define JOB_GENERIC_ALL
#define OBT_CUSTOM_KEY
Definition: ObTypes.cpp:192
const UCHAR TypeIndex_WaitablePort[]
Definition: ObTypes.cpp:35
#define IoCompletionObjectType
Definition: ObTypes.cpp:182
const UCHAR TypeIndex_Timer[]
Definition: ObTypes.cpp:27
const UCHAR TypeIndex_KeyedEvent[]
Definition: ObTypes.cpp:29
const UCHAR TypeIndex_Process[]
Definition: ObTypes.cpp:18
const UCHAR TypeIndex_DebugObject[]
Definition: ObTypes.cpp:21
const UCHAR TypeIndex_Job[]
Definition: ObTypes.cpp:20
#define ExProfileObjectType
Definition: ObTypes.cpp:177
#define WmipGuidObjectType
Definition: ObTypes.cpp:183
#define TOKEN_GENERIC_READ
#define IoControllerObjectType
Definition: ObTypes.cpp:181
const UCHAR TypeIndex_Adapter[]
Definition: ObTypes.cpp:36
const UCHAR TypeIndex_SymbolicLink[]
Definition: ObTypes.cpp:16
#define OBT_CUSTOM_SECURITY_PROC
Definition: ObTypes.cpp:186
const UCHAR TypeIndex_FilterCommunicationPort[]
Definition: ObTypes.cpp:44
const UCHAR TypeIndex_Key[]
Definition: ObTypes.cpp:33
const UCHAR TypeIndex_Token[]
Definition: ObTypes.cpp:17
#define ExEventPairObjectType
Definition: ObTypes.cpp:173
#define THREAD_GENERIC_WRITE
#define PROCESS_GENERIC_WRITE
#define THREAD_GENERIC_EXECUTE
const UCHAR TypeIndex_Directory[]
Definition: ObTypes.cpp:15
const UCHAR TypeIndex_Device[]
Definition: ObTypes.cpp:38
#define OBT_CASE_INSENSITIVE
Definition: ObTypes.cpp:188
const UCHAR TypeIndex_File[]
Definition: ObTypes.cpp:41
#define LpcWaitablePortObjectType
Definition: ObTypes.cpp:180
const UCHAR TypeIndex_FilterConnectionPort[]
Definition: ObTypes.cpp:43
static VOID TestObjectTypes(VOID)
Definition: ObTypes.cpp:199
#define ExTimerObjectType
Definition: ObTypes.cpp:176
const UCHAR TypeIndex_Type[]
Definition: ObTypes.cpp:14
#define OBT_NO_DEFAULT
Definition: ObTypes.cpp:185
#define OBT_MAINTAIN_HANDLE_COUNT
Definition: ObTypes.cpp:190
#define DIR_SEC_REQUIRED
#define OBT_MAINTAIN_TYPE_LIST
Definition: ObTypes.cpp:189
const UCHAR TypeIndex_Callback[]
Definition: ObTypes.cpp:25
const UCHAR TypeIndex_Driver[]
Definition: ObTypes.cpp:39
#define PROCESS_GENERIC_EXECUTE
const UCHAR TypeIndex_Controller[]
Definition: ObTypes.cpp:37
const UCHAR TypeIndex_Thread[]
Definition: ObTypes.cpp:19
#define ObpSymbolicLinkObjectType
Definition: ObTypes.cpp:171
const UCHAR TypeIndex_WindowStation[]
Definition: ObTypes.cpp:30
#define DbgkDebugObjectType
Definition: ObTypes.cpp:172
#define OBT_SECURITY_REQUIRED
Definition: ObTypes.cpp:187
const UCHAR TypeIndex_Profile[]
Definition: ObTypes.cpp:28
#define TOKEN_GENERIC_WRITE
#define ExpKeyedEventObjectType
Definition: ObTypes.cpp:178
#define CmpKeyObjectType
Definition: ObTypes.cpp:179
#define ExCallbackObjectType
Definition: ObTypes.cpp:175
#define ExMutantObjectType
Definition: ObTypes.cpp:174
#define CheckObjectType(TypeName, Variable, Flags, InvalidAttr, ReadMapping, WriteMapping, ExecMapping, AllMapping, ValidMask)
Definition: ObTypes.cpp:95
#define PROCESS_GENERIC_ALL
#define OBT_PAGED_POOL
Definition: ObTypes.cpp:191
const UCHAR TypeIndex_IoCompletion[]
Definition: ObTypes.cpp:40
const UCHAR TypeIndex_Event[]
Definition: ObTypes.cpp:22
#define THREAD_GENERIC_ALL
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
Definition: ObTypes.cpp:68
const UCHAR TypeIndex_Mutant[]
Definition: ObTypes.cpp:24
const UCHAR TypeIndex_Desktop[]
Definition: ObTypes.cpp:31
const UCHAR TypeIndex_EventPair[]
Definition: ObTypes.cpp:23
const UCHAR TypeIndex_WmiGuid[]
Definition: ObTypes.cpp:42
const UCHAR TypeIndex_Port[]
Definition: ObTypes.cpp:34
Type
Definition: Type.h:7
#define ok_eq_pointer(value, expected)
Definition: apitest.h:116
#define ok_eq_hex(value, expected)
Definition: apitest.h:134
static ULONG GetNTDDIVersion(VOID)
Definition: apitest.h:23
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
LONG NTSTATUS
Definition: precomp.h:26
Definition: File.h:16
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
static CHAR Desktop[MAX_PATH]
Definition: dem.c:256
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
static const WCHAR SymbolicLink[]
Definition: interface.c:31
#define L(x)
Definition: resources.c:13
NTSTATUS NTAPI IoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Ctx)
Definition: control.c:393
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:24
CPPORT Port[4]
Definition: headless.c:38
POBJECT_TYPE IoDeviceObjectType
Definition: iomgr.c:35
POBJECT_TYPE IoFileObjectType
Definition: iomgr.c:36
POBJECT_TYPE LpcPortObjectType
Definition: port.c:17
ObjectType
Definition: metafile.c:88
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:115
#define KernelMode
Definition: asm.h:38
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
NTSTATUS(NTAPI * OB_SECURITY_METHOD)(_In_ PVOID Object, _In_ SECURITY_OPERATION_CODE OperationType, _In_ PSECURITY_INFORMATION SecurityInformation, _In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Inout_ PULONG CapturedLength, _Inout_ PSECURITY_DESCRIPTOR *ObjectSecurityDescriptor, _In_ POOL_TYPE PoolType, _In_ PGENERIC_MAPPING GenericMapping)
Definition: obtypes.h:229
_In_ BOOLEAN _In_ USHORT Directory
Definition: rtlfuncs.h:3942
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
OBJECT_TYPE
Definition: ntobjenum.h:13
POBJECT_TYPE ExEventObjectType
Definition: event.c:18
NTSTATUS NTAPI SeDefaultObjectMethod(_In_ PVOID Object, _In_ SECURITY_OPERATION_CODE OperationType, _In_ PSECURITY_INFORMATION SecurityInformation, _Inout_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Inout_opt_ PULONG ReturnLength, _Inout_opt_ PSECURITY_DESCRIPTOR *OldSecurityDescriptor, _In_ POOL_TYPE PoolType, _In_ PGENERIC_MAPPING GenericMapping)
POBJECT_TYPE IoDeviceHandlerObjectType
Definition: adapter.c:19
POBJECT_TYPE IoAdapterObjectType
Definition: adapter.c:18
POBJECT_TYPE IoDriverObjectType
Definition: driver.c:34
POBJECT_TYPE PsProcessType
Definition: process.c:20
POBJECT_TYPE PsThreadType
Definition: thread.c:20
POBJECT_TYPE SeTokenObjectType
Definition: token.c:17
POBJECT_TYPE ObpTypeObjectType
Definition: oblife.c:22
KEVENT ObpDefaultObject
Definition: oblife.c:23
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
Definition: obhandle.c:2535
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:493
POBJECT_TYPE PsJobType
Definition: job.c:20
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define NTDDI_VISTA
Definition: sdkddkver.h:103
#define NTDDI_WS03
Definition: sdkddkver.h:92
#define NTDDI_WIN7
Definition: sdkddkver.h:112
#define NTDDI_VISTASP2
Definition: sdkddkver.h:105
#define NTDDI_VISTASP3
Definition: sdkddkver.h:106
#define NTDDI_VISTASP1
Definition: sdkddkver.h:104
POBJECT_TYPE MmSectionObjectType
Definition: section.c:196
POBJECT_TYPE ExSemaphoreObjectType
Definition: sem.c:22
#define STATUS_SUCCESS
Definition: shellext.h:65
OB_SECURITY_METHOD SecurityProcedure
Definition: obtypes.h:371
OBJECT_TYPE_INITIALIZER TypeInfo
Definition: obtypes.h:390
ULONG Key
Definition: obtypes.h:391
PVOID DefaultObject
Definition: obtypes.h:384
Definition: fs_rec.h:143
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char UCHAR
Definition: typedefs.h:53
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
POBJECT_TYPE ExDesktopObjectType
Definition: win32k.c:22
POBJECT_TYPE ExWindowStationObjectType
Definition: win32k.c:21
#define ObDereferenceObject
Definition: obfuncs.h:203