1 #ifndef _INCLUDE_DDK_OBTYPES_H
2 #define _INCLUDE_DDK_OBTYPES_H
4 struct _DIRECTORY_OBJECT;
5 struct _OBJECT_ATTRIBUTES;
7 typedef ULONG ACCESS_STATE, *PACCESS_STATE;
9 typedef struct _OBJECT_HANDLE_INFORMATION {
10 ULONG HandleAttributes;
11 ACCESS_MASK GrantedAccess;
12 } OBJECT_HANDLE_INFORMATION, *POBJECT_HANDLE_INFORMATION;
14 typedef struct _OBJECT_TYPE
17 * PURPOSE: Tag to be used when allocating objects of this type
22 * PURPOSE: Name of the type
24 UNICODE_STRING TypeName;
27 * PURPOSE: Total number of objects of this type
32 * PURPOSE: Total number of handles of this type
37 * PURPOSE: Maximum objects of this type
42 * PURPOSE: Maximum handles of this type
47 * PURPOSE: Paged pool charge
49 ULONG PagedPoolCharge;
52 * PURPOSE: Nonpaged pool charge
54 ULONG NonpagedPoolCharge;
57 * PURPOSE: Mapping of generic access rights
59 PGENERIC_MAPPING Mapping;
62 * PURPOSE: Dumps the object
65 VOID STDCALL (*Dump)(VOID);
68 * PURPOSE: Opens the object
71 VOID STDCALL (*Open)(VOID);
74 * PURPOSE: Called to close an object if OkayToClose returns true
76 VOID STDCALL (*Close)(PVOID ObjectBody,
80 * PURPOSE: Called to delete an object when the last reference is removed
82 VOID STDCALL (*Delete)(PVOID ObjectBody);
85 * PURPOSE: Called when an open attempts to open a file apparently
86 * residing within the object
88 * STATUS_SUCCESS NextObject was found
89 * STATUS_UNSUCCESSFUL NextObject not found
90 * STATUS_REPARSE Path changed, restart parsing the path
92 NTSTATUS STDCALL (*Parse)(PVOID ParsedObject,
94 PUNICODE_STRING FullPath,
100 NTSTATUS STDCALL (*Security)(PVOID Object,
107 VOID STDCALL (*QueryName)(VOID);
110 * PURPOSE: Called when a process asks to close the object
112 VOID STDCALL (*OkayToClose)(VOID);
114 NTSTATUS STDCALL (*Create)(PVOID ObjectBody,
117 struct _OBJECT_ATTRIBUTES* ObjectAttributes);
119 VOID STDCALL (*DuplicationNotify)(PEPROCESS DuplicateTo,
120 PEPROCESS DuplicateFrom,
122 } OBJECT_TYPE, *POBJECT_TYPE;
125 typedef struct _OBJECT_HEADER
127 * PURPOSE: Header for every object managed by the object manager
134 BOOLEAN CloseInProcess;
136 struct _DIRECTORY_OBJECT* Parent;
137 POBJECT_TYPE ObjectType;
140 * PURPOSE: Object type
141 * NOTE: This overlaps the first member of the object body
146 * PURPOSE: Object size
147 * NOTE: This overlaps the second member of the object body
152 } OBJECT_HEADER, *POBJECT_HEADER;
154 typedef struct _OBJECT_ATTRIBUTES
157 HANDLE RootDirectory;
158 PUNICODE_STRING ObjectName;
160 SECURITY_DESCRIPTOR *SecurityDescriptor;
161 SECURITY_QUALITY_OF_SERVICE *SecurityQualityOfService;
162 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
164 typedef struct _HANDLE_TABLE
168 } HANDLE_TABLE, *PHANDLE_TABLE;
170 extern POBJECT_TYPE ObDirectoryType;
173 #define OBJECT_TYPE_0 0
174 #define OBJECT_TYPE_1 1
175 #define OBJECT_TYPE_DIRECTORY 2
176 #define OBJECT_TYPE_SYMBOLICLINK 3
177 #define OBJECT_TYPE_TOKEN 4
178 #define OBJECT_TYPE_PROCESS 5
179 #define OBJECT_TYPE_THREAD 6
180 #define OBJECT_TYPE_EVENT 7
181 #define OBJECT_TYPE_8 8
182 #define OBJECT_TYPE_MUTANT 9
183 #define OBJECT_TYPE_SEMAPHORE 10
184 #define OBJECT_TYPE_TIMER 11
185 #define OBJECT_TYPE_12 12
186 #define OBJECT_TYPE_WINDOWSTATION 13
187 #define OBJECT_TYPE_DESKTOP 14
188 #define OBJECT_TYPE_SECTION 15
189 #define OBJECT_TYPE_KEY 16
190 #define OBJECT_TYPE_PORT 17
191 #define OBJECT_TYPE_18 18
192 #define OBJECT_TYPE_19 19
193 #define OBJECT_TYPE_20 20
194 #define OBJECT_TYPE_21 21
195 #define OBJECT_TYPE_IOCOMPLETION 22
196 #define OBJECT_TYPE_FILE 23
199 #endif /* ndef _INCLUDE_DDK_OBTYPES_H */