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_FUNC (*Dump)(VOID);
68 * PURPOSE: Opens the object
71 VOID STDCALL_FUNC (*Open)(VOID);
74 * PURPOSE: Called to close an object if OkayToClose returns true
76 VOID STDCALL_FUNC (*Close)(PVOID ObjectBody,
80 * PURPOSE: Called to delete an object when the last reference is removed
82 VOID STDCALL_FUNC (*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_FUNC (*Parse)(PVOID ParsedObject,
94 PUNICODE_STRING FullPath,
99 * PURPOSE: Called to set, query, delete or assign a security-descriptor
102 * STATUS_SUCCESS NextObject was found
104 NTSTATUS STDCALL_FUNC (*Security)(PVOID ObjectBody,
105 SECURITY_OPERATION_CODE OperationCode,
106 SECURITY_INFORMATION SecurityInformation,
107 PSECURITY_DESCRIPTOR SecurityDescriptor,
108 PULONG BufferLength);
112 VOID STDCALL_FUNC (*QueryName)(VOID);
115 * PURPOSE: Called when a process asks to close the object
117 VOID STDCALL_FUNC (*OkayToClose)(VOID);
119 NTSTATUS STDCALL_FUNC (*Create)(PVOID ObjectBody,
122 struct _OBJECT_ATTRIBUTES* ObjectAttributes);
124 VOID STDCALL_FUNC (*DuplicationNotify)(PEPROCESS DuplicateTo,
125 PEPROCESS DuplicateFrom,
127 } OBJECT_TYPE, *POBJECT_TYPE;
130 typedef struct _OBJECT_HEADER
132 * PURPOSE: Header for every object managed by the object manager
139 BOOLEAN CloseInProcess;
141 struct _DIRECTORY_OBJECT* Parent;
142 POBJECT_TYPE ObjectType;
145 * PURPOSE: Object type
146 * NOTE: This overlaps the first member of the object body
151 * PURPOSE: Object size
152 * NOTE: This overlaps the second member of the object body
157 } OBJECT_HEADER, *POBJECT_HEADER;
159 typedef struct _OBJECT_ATTRIBUTES
162 HANDLE RootDirectory;
163 PUNICODE_STRING ObjectName;
165 SECURITY_DESCRIPTOR *SecurityDescriptor;
166 SECURITY_QUALITY_OF_SERVICE *SecurityQualityOfService;
167 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
169 typedef struct _HANDLE_TABLE
173 } HANDLE_TABLE, *PHANDLE_TABLE;
175 extern POBJECT_TYPE ObDirectoryType;
178 #define OBJECT_TYPE_0 0
179 #define OBJECT_TYPE_1 1
180 #define OBJECT_TYPE_DIRECTORY 2
181 #define OBJECT_TYPE_SYMBOLICLINK 3
182 #define OBJECT_TYPE_TOKEN 4
183 #define OBJECT_TYPE_PROCESS 5
184 #define OBJECT_TYPE_THREAD 6
185 #define OBJECT_TYPE_EVENT 7
186 #define OBJECT_TYPE_8 8
187 #define OBJECT_TYPE_MUTANT 9
188 #define OBJECT_TYPE_SEMAPHORE 10
189 #define OBJECT_TYPE_TIMER 11
190 #define OBJECT_TYPE_12 12
191 #define OBJECT_TYPE_WINDOWSTATION 13
192 #define OBJECT_TYPE_DESKTOP 14
193 #define OBJECT_TYPE_SECTION 15
194 #define OBJECT_TYPE_KEY 16
195 #define OBJECT_TYPE_PORT 17
196 #define OBJECT_TYPE_18 18
197 #define OBJECT_TYPE_19 19
198 #define OBJECT_TYPE_20 20
199 #define OBJECT_TYPE_21 21
200 #define OBJECT_TYPE_IOCOMPLETION 22
201 #define OBJECT_TYPE_FILE 23
204 #endif /* ndef _INCLUDE_DDK_OBTYPES_H */