40#define ok_eq_ustr(value, expected) ok(RtlEqualUnicodeString(value, expected, FALSE), #value " = \"%wZ\", expected \"%%wZ\"\n", value, expected)
42#define CheckObjectType(TypeName, Variable, Flags, InvalidAttr, \
43 ReadMapping, WriteMapping, ExecMapping, AllMapping, \
46 POBJECT_TYPE ObjectType; \
47 UNICODE_STRING Name; \
49 BOOLEAN UseDefault = ((Flags) & OBT_NO_DEFAULT) == 0; \
50 BOOLEAN CustomSecurityProc = ((Flags) & OBT_CUSTOM_SECURITY_PROC) != 0; \
51 BOOLEAN SecurityRequired = ((Flags) & OBT_SECURITY_REQUIRED) != 0; \
52 BOOLEAN CaseInsensitive = ((Flags) & OBT_CASE_INSENSITIVE) != 0; \
53 BOOLEAN MaintainTypeList = ((Flags) & OBT_MAINTAIN_TYPE_LIST) != 0; \
54 BOOLEAN MaintainHandleCount = ((Flags) & OBT_MAINTAIN_HANDLE_COUNT) != 0; \
55 POOL_TYPE PoolType = ((Flags) & OBT_PAGED_POOL) ? PagedPool : NonPagedPool; \
56 BOOLEAN CustomKey = ((Flags) & OBT_CUSTOM_KEY) != 0; \
58 trace(#TypeName "\n"); \
59 ObjectType = GetObjectType(L"\\ObjectTypes\\" L ## #TypeName); \
60 ok(ObjectType != NULL, "ObjectType = NULL\n"); \
61 if (!skip(ObjectType != NULL, "No ObjectType\n")) \
63 ok(!Variable || Variable == ObjectType, \
64 #Variable "is %p, expected %p\n", Variable, ObjectType); \
65 RtlInitUnicodeString(&Name, L ## #TypeName); \
66 ok_eq_ustr(&ObjectType->Name, &Name); \
67 ok_eq_ulong(ObjectType->Index, Index); \
68 Index = ObjectType->Index + 1; \
72 ok_eq_pointer(ObjectType->DefaultObject, ObpDefaultObject); \
78 ok(ObjectType->HighWaterNumberOfObjects >= ObjectType->TotalNumberOfObjects,\
79 "%lu objects, but high water %lu\n", \
80 ObjectType->TotalNumberOfObjects, ObjectType->HighWaterNumberOfObjects); \
81 ok(ObjectType->HighWaterNumberOfHandles >= ObjectType->TotalNumberOfHandles,\
82 "%lu handles, but high water %lu\n", \
83 ObjectType->TotalNumberOfHandles, ObjectType->HighWaterNumberOfHandles); \
84 ok_eq_ulong(ObjectType->TypeInfo.Length, sizeof(OBJECT_TYPE_INITIALIZER)); \
85 ok_eq_bool(ObjectType->TypeInfo.UseDefaultObject, UseDefault); \
86 ok_eq_bool(ObjectType->TypeInfo.CaseInsensitive, CaseInsensitive); \
87 ok_eq_hex(ObjectType->TypeInfo.InvalidAttributes, InvalidAttr); \
88 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericRead, ReadMapping); \
89 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericWrite, WriteMapping); \
90 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericExecute, ExecMapping); \
91 ok_eq_hex(ObjectType->TypeInfo.GenericMapping.GenericAll, AllMapping); \
92 ok_eq_hex(ObjectType->TypeInfo.ValidAccessMask, ValidMask); \
93 ok_eq_bool(ObjectType->TypeInfo.SecurityRequired, SecurityRequired); \
94 ok_eq_bool(ObjectType->TypeInfo.MaintainHandleCount, MaintainHandleCount); \
95 ok_eq_bool(ObjectType->TypeInfo.MaintainTypeList, MaintainTypeList); \
96 ok_eq_ulong(ObjectType->TypeInfo.PoolType, PoolType); \
104 if (CustomSecurityProc) \
105 ok(ObjectType->TypeInfo.SecurityProcedure != NULL, \
106 "No Security Proc\n"); \
108 ok_eq_pointer(ObjectType->TypeInfo.SecurityProcedure, \
109 SeDefaultObjectMethod); \
112 Key = *(PULONG)#TypeName; \
113 if (sizeof(#TypeName) <= 4) Key |= ' ' << 24; \
114 if (sizeof(#TypeName) <= 3) Key |= ' ' << 16; \
115 if (sizeof(#TypeName) <= 2) Key |= ' ' << 8; \
117 ok_eq_hex(ObjectType->Key, Key); \
118 ObDereferenceObject(ObjectType); \
123#define ObpDirectoryObjectType NULL
124#define ObpSymbolicLinkObjectType NULL
125#define DbgkDebugObjectType NULL
126#define ExEventPairObjectType NULL
127#define ExMutantObjectType NULL
128#define ExCallbackObjectType NULL
129#define ExTimerObjectType NULL
130#define ExProfileObjectType NULL
131#define ExpKeyedEventObjectType NULL
132#define CmpKeyObjectType NULL
133#define LpcWaitablePortObjectType NULL
134#define IoControllerObjectType NULL
135#define IoCompletionObjectType NULL
136#define WmipGuidObjectType NULL
141#define OBT_NO_DEFAULT 0x01
142#define OBT_CUSTOM_SECURITY_PROC 0x02
143#define OBT_SECURITY_REQUIRED 0x04
144#define OBT_CASE_INSENSITIVE 0x08
145#define OBT_MAINTAIN_TYPE_LIST 0x10
146#define OBT_MAINTAIN_HANDLE_COUNT 0x20
147#define OBT_PAGED_POOL 0x40
148#define OBT_CUSTOM_KEY 0x80
150#define TAG(x) RtlUlongByteSwap(x)
167#ifdef _PROPER_NT_NDK_EXPORTS
168#define ObpTypeObjectType *ObpTypeObjectType
169#define ObpDirectoryObjectType *ObpDirectoryObjectType
170#define ObpSymbolicLinkObjectType *ObpSymbolicLinkObjectType
171#define PsJobType *PsJobType
172#define DbgkDebugObjectType *DbgkDebugObjectType
173#define ExEventPairObjectType *ExEventPairObjectType
174#define ExMutantObjectType *ExMutantObjectType
175#define ExCallbackObjectType *ExCallbackObjectType
176#define ExTimerObjectType *ExTimerObjectType
177#define ExProfileObjectType *ExProfileObjectType
178#define ExpKeyedEventObjectType *ExpKeyedEventObjectType
179#define ExWindowStationObjectType *ExWindowStationObjectType
180#define ExDesktopObjectType *ExDesktopObjectType
181#define MmSectionObjectType *MmSectionObjectType
182#define CmpKeyObjectType *CmpKeyObjectType
183#define LpcPortObjectType *LpcPortObjectType
184#define LpcWaitablePortObjectType *LpcWaitablePortObjectType
185#define IoAdapterObjectType *IoAdapterObjectType
186#define IoControllerObjectType *IoControllerObjectType
187#define IoDeviceObjectType *IoDeviceObjectType
188#define IoDriverObjectType *IoDriverObjectType
189#define IoCompletionObjectType *IoCompletionObjectType
190#define WmipGuidObjectType *WmipGuidObjectType
212 0x130, 0x020303, 0x02001c, 0x020060, 0x0f037f, 0x0f037f);
214 0x130, 0x020041, 0x0200be, 0x020100, 0x0f01ff, 0x0f01ff);
217 0x030, 0x020019, 0x020006, 0x020019, 0x0f003f, 0x1f003f);
225 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
229 0x130, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff);
231 0x100, 0x000001, 0x000002, 0x000010, 0x120fff, 0x1f0fff);
static POBJECT_TYPE ObTypes[NUM_OBTYPES]
#define ObpDirectoryObjectType
#define IoCompletionObjectType
static POBJECT_TYPE ObpDefaultObject
static POBJECT_TYPE ObpTypeObjectType
#define ExProfileObjectType
#define WmipGuidObjectType
#define IoControllerObjectType
#define OBT_CUSTOM_SECURITY_PROC
static OB_SECURITY_METHOD SeDefaultObjectMethod
#define ExEventPairObjectType
#define OBT_CASE_INSENSITIVE
static VOID TestObjectTypes(VOID)
#define LpcWaitablePortObjectType
#define ExTimerObjectType
#define OBT_MAINTAIN_HANDLE_COUNT
#define OBT_MAINTAIN_TYPE_LIST
#define ObpSymbolicLinkObjectType
#define DbgkDebugObjectType
#define OBT_SECURITY_REQUIRED
#define ExpKeyedEventObjectType
#define ExCallbackObjectType
#define ExMutantObjectType
#define CheckObjectType(TypeName, Variable, Flags, InvalidAttr, ReadMapping, WriteMapping, ExecMapping, AllMapping, ValidMask)
static POBJECT_TYPE GetObjectType(IN PCWSTR TypeName)
#define ok_eq_pointer(value, expected)
#define ok_eq_hex(value, expected)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
static const WCHAR SymbolicLink[]
NTSTATUS NTAPI IoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Ctx)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
POBJECT_TYPE IoDeviceObjectType
POBJECT_TYPE IoFileObjectType
POBJECT_TYPE LpcPortObjectType
#define InitializeObjectAttributes(p, n, a, r, s)
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)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
POBJECT_TYPE ExEventObjectType
POBJECT_TYPE IoDeviceHandlerObjectType
POBJECT_TYPE IoAdapterObjectType
POBJECT_TYPE IoDriverObjectType
POBJECT_TYPE PsProcessType
POBJECT_TYPE PsThreadType
POBJECT_TYPE SeTokenObjectType
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)
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)
POBJECT_TYPE MmSectionObjectType
POBJECT_TYPE ExSemaphoreObjectType
base for all directory entries
OB_SECURITY_METHOD SecurityProcedure
OBJECT_TYPE_INITIALIZER TypeInfo
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDRIVER Driver
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
POBJECT_TYPE ExDesktopObjectType
POBJECT_TYPE ExWindowStationObjectType
#define ObDereferenceObject