bool ClasList<T>::Delete(T *obj) { if(MultiType) { int n=TypeCount; while(n--) clas_object[n].Delete(obj); } else clas_object[CheckObjectType(obj)].Delete(obj); return all_object.Delete(obj); }
void ClasList<T>::Add(T *obj) { if(MultiType) { int n=TypeCount; while(n--) if(CheckObjectAttrib(obj,n)) clas_object[n].Add(obj); } else clas_object[CheckObjectType(obj)].Add(obj); all_object+=obj; }
static VOID TestObjectTypes(VOID) { ULONG Index; ObpTypeObjectType = GetObjectType(L"\\ObjectTypes\\Type"); if (skip(ObpTypeObjectType != NULL, "No Type object type\n")) return; ObpDefaultObject = ObpTypeObjectType->DefaultObject; ok(ObpDefaultObject != NULL, "No ObpDefaultObject\n"); SeDefaultObjectMethod = ObpTypeObjectType->TypeInfo.SecurityProcedure; ok(SeDefaultObjectMethod != NULL, "No SeDefaultObjectMethod\n"); #ifdef _PROPER_NT_NDK_EXPORTS #define ObpTypeObjectType *ObpTypeObjectType #define ObpDirectoryObjectType *ObpDirectoryObjectType #define ObpSymbolicLinkObjectType *ObpSymbolicLinkObjectType #define PsJobType *PsJobType #define DbgkDebugObjectType *DbgkDebugObjectType #define ExEventPairObjectType *ExEventPairObjectType #define ExMutantObjectType *ExMutantObjectType #define ExCallbackObjectType *ExCallbackObjectType #define ExTimerObjectType *ExTimerObjectType #define ExProfileObjectType *ExProfileObjectType #define ExpKeyedEventObjectType *ExpKeyedEventObjectType #define ExWindowStationObjectType *ExWindowStationObjectType #define ExDesktopObjectType *ExDesktopObjectType #define MmSectionObjectType *MmSectionObjectType #define CmpKeyObjectType *CmpKeyObjectType #define LpcPortObjectType *LpcPortObjectType #define LpcWaitablePortObjectType *LpcWaitablePortObjectType #define IoAdapterObjectType *IoAdapterObjectType #define IoControllerObjectType *IoControllerObjectType #define IoDeviceObjectType *IoDeviceObjectType #define IoDriverObjectType *IoDriverObjectType #define IoCompletionObjectType *IoCompletionObjectType #define WmipGuidObjectType *WmipGuidObjectType #endif Index = 1; CheckObjectType(Type, ObpTypeObjectType, OBT_MAINTAIN_TYPE_LIST | OBT_CUSTOM_KEY, 0x100, 0x020000, 0x020000, 0x020000, 0x0f0001, 0x1f0001); ok_eq_hex(ObpTypeObjectType->Key, TAG('ObjT')); CheckObjectType(Directory, ObpDirectoryObjectType, OBT_CASE_INSENSITIVE | OBT_PAGED_POOL, 0x100, 0x020003, 0x02000c, 0x020003, 0x0f000f, 0x0f000f); CheckObjectType(SymbolicLink, ObpSymbolicLinkObjectType, OBT_CASE_INSENSITIVE | OBT_PAGED_POOL, 0x100, 0x020001, 0x020000, 0x020001, 0x0f0001, 0x0f0001); CheckObjectType(Token, *SeTokenObjectType, OBT_SECURITY_REQUIRED | OBT_PAGED_POOL, 0x100, 0x020008, 0x0200e0, 0x020000, 0x0f01ff, 0x1f01ff); CheckObjectType(Process, *PsProcessType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x0b0, 0x020410, 0x020beb, 0x120000, 0x1f0fff, 0x1f0fff); CheckObjectType(Thread, *PsThreadType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x0b0, 0x020048, 0x020037, 0x120000, 0x1f03ff, 0x1f03ff); CheckObjectType(Job, PsJobType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x000, 0x020004, 0x02000b, 0x120000, 0x1f03ff, 0x1f001f); CheckObjectType(DebugObject, DbgkDebugObjectType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x000, 0x020001, 0x020002, 0x120000, 0x1f000f, 0x1f000f); CheckObjectType(Event, *ExEventObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(EventPair, ExEventPairObjectType, 0, 0x100, 0x120000, 0x120000, 0x120000, 0x1f0000, 0x1f0000); CheckObjectType(Mutant, ExMutantObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020000, 0x120000, 0x1f0001, 0x1f0001); CheckObjectType(Callback, ExCallbackObjectType, OBT_NO_DEFAULT, 0x100, 0x020000, 0x020001, 0x120000, 0x1f0001, 0x1f0001); CheckObjectType(Semaphore, *ExSemaphoreObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(Timer, ExTimerObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(Profile, ExProfileObjectType, OBT_NO_DEFAULT, 0x100, 0x020001, 0x020001, 0x020001, 0x0f0001, 0x0f0001); CheckObjectType(KeyedEvent, ExpKeyedEventObjectType, OBT_PAGED_POOL, 0x000, 0x020001, 0x020002, 0x020000, 0x0f0003, 0x1f0003); CheckObjectType(WindowStation, ExWindowStationObjectType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED | OBT_MAINTAIN_HANDLE_COUNT, 0x130, 0x020303, 0x02001c, 0x020060, 0x0f037f, 0x0f037f); CheckObjectType(Desktop, ExDesktopObjectType, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED | OBT_MAINTAIN_HANDLE_COUNT, 0x130, 0x020041, 0x0200be, 0x020100, 0x0f01ff, 0x0f01ff); CheckObjectType(Section, MmSectionObjectType, OBT_PAGED_POOL, 0x100, 0x020005, 0x020002, 0x020008, 0x0f001f, 0x1f001f); CheckObjectType(Key, CmpKeyObjectType, OBT_CUSTOM_SECURITY_PROC | OBT_SECURITY_REQUIRED | OBT_PAGED_POOL, 0x030, 0x020019, 0x020006, 0x020019, 0x0f003f, 0x1f003f); CheckObjectType(Port, LpcPortObjectType, OBT_PAGED_POOL, 0x7b2, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001); CheckObjectType(WaitablePort, LpcWaitablePortObjectType, OBT_NO_DEFAULT, 0x7b2, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001); CheckObjectType(Adapter, IoAdapterObjectType, 0, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(Controller, IoControllerObjectType, 0, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(Device, IoDeviceObjectType, OBT_CUSTOM_SECURITY_PROC | OBT_CASE_INSENSITIVE, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(Driver, IoDriverObjectType, OBT_CASE_INSENSITIVE, 0x100, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(IoCompletion, IoCompletionObjectType, OBT_CASE_INSENSITIVE, 0x110, 0x020001, 0x020002, 0x120000, 0x1f0003, 0x1f0003); CheckObjectType(File, *IoFileObjectType, OBT_NO_DEFAULT | OBT_CUSTOM_SECURITY_PROC | OBT_CASE_INSENSITIVE | OBT_MAINTAIN_HANDLE_COUNT, 0x130, 0x120089, 0x120116, 0x1200a0, 0x1f01ff, 0x1f01ff); CheckObjectType(WmiGuid, WmipGuidObjectType, OBT_NO_DEFAULT | OBT_CUSTOM_SECURITY_PROC | OBT_SECURITY_REQUIRED, 0x100, 0x000001, 0x000002, 0x000010, 0x120fff, 0x1f0fff); CheckObjectType(FilterConnectionPort, NULL, OBT_NO_DEFAULT | OBT_SECURITY_REQUIRED, 0x100, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001); CheckObjectType(FilterCommunicationPort, NULL, OBT_NO_DEFAULT, 0x100, 0x020001, 0x010001, 0x000000, 0x1f0001, 0x1f0001); // exported but not created ok_eq_pointer(IoDeviceHandlerObjectType, NULL); // my Win7/x64 additionally has: // ALPC Port // EtwConsumer // EtwRegistration // IoCompletionReserve // PcwObject // PowerRequest // Session // TmEn // TmRm // TmTm // TmTx // TpWorkerFactory // UserApcReserve // ... and does not have: // Port // WaitablePort ObDereferenceObject(ObpTypeObjectType); }