1 #ifndef _INCLUDE_DDK_OBTYPES_H
2 #define _INCLUDE_DDK_OBTYPES_H
4 struct _DIRECTORY_OBJECT;
5 struct _OBJECT_ATTRIBUTES;
9 typedef struct _ACCESS_STATE
12 BOOLEAN SecurityEvaluated;
13 BOOLEAN GenerateAudit;
14 BOOLEAN GenerateOnClose;
15 BOOLEAN PrivilegesAllocated;
17 ACCESS_MASK RemainingDesiredAccess;
18 ACCESS_MASK PreviouslyGrantedAccess;
19 ACCESS_MASK OriginalDesiredAccess;
20 SECURITY_SUBJECT_CONTEXT SubjectSecurityContext;
21 PSECURITY_DESCRIPTOR SecurityDescriptor;
25 INITIAL_PRIVILEGE_SET InitialPrivilegeSet;
26 PRIVILEGE_SET PrivilegeSet;
29 BOOLEAN AuditPrivileges;
30 UNICODE_STRING ObjectName;
31 UNICODE_STRING ObjectTypeName;
32 } ACCESS_STATE, *PACCESS_STATE;
34 typedef struct _OBJECT_NAME_INFORMATION
37 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
39 typedef struct _OBJECT_HANDLE_INFORMATION
41 ULONG HandleAttributes;
42 ACCESS_MASK GrantedAccess;
43 } OBJECT_HANDLE_INFORMATION, *POBJECT_HANDLE_INFORMATION;
45 #endif /* __USE_W32API */
47 typedef struct _OBJECT_TYPE
50 * PURPOSE: Tag to be used when allocating objects of this type
55 * PURPOSE: Name of the type
57 UNICODE_STRING TypeName;
60 * PURPOSE: Total number of objects of this type
65 * PURPOSE: Total number of handles of this type
70 * PURPOSE: Maximum objects of this type
75 * PURPOSE: Maximum handles of this type
80 * PURPOSE: Paged pool charge
82 ULONG PagedPoolCharge;
85 * PURPOSE: Nonpaged pool charge
87 ULONG NonpagedPoolCharge;
90 * PURPOSE: Mapping of generic access rights
92 PGENERIC_MAPPING Mapping;
95 * PURPOSE: Dumps the object
98 VOID STDCALL_FUNC (*Dump)(VOID);
101 * PURPOSE: Opens the object
102 * NOTE: To be defined
104 VOID STDCALL_FUNC (*Open)(VOID);
107 * PURPOSE: Called to close an object if OkayToClose returns true
109 VOID STDCALL_FUNC (*Close)(PVOID ObjectBody,
113 * PURPOSE: Called to delete an object when the last reference is removed
115 VOID STDCALL_FUNC (*Delete)(PVOID ObjectBody);
118 * PURPOSE: Called when an open attempts to open a file apparently
119 * residing within the object
121 * STATUS_SUCCESS NextObject was found
122 * STATUS_UNSUCCESSFUL NextObject not found
123 * STATUS_REPARSE Path changed, restart parsing the path
125 NTSTATUS STDCALL_FUNC (*Parse)(PVOID ParsedObject,
127 PUNICODE_STRING FullPath,
132 * PURPOSE: Called to set, query, delete or assign a security-descriptor
135 * STATUS_SUCCESS NextObject was found
137 NTSTATUS STDCALL_FUNC (*Security)(PVOID ObjectBody,
138 SECURITY_OPERATION_CODE OperationCode,
139 SECURITY_INFORMATION SecurityInformation,
140 PSECURITY_DESCRIPTOR SecurityDescriptor,
141 PULONG BufferLength);
144 * PURPOSE: Called to query the name of the object
146 * STATUS_SUCCESS NextObject was found
148 NTSTATUS STDCALL_FUNC (*QueryName)(PVOID ObjectBody,
149 POBJECT_NAME_INFORMATION ObjectNameInfo,
151 PULONG ReturnLength);
154 * PURPOSE: Called when a process asks to close the object
156 VOID STDCALL_FUNC (*OkayToClose)(VOID);
158 NTSTATUS STDCALL_FUNC (*Create)(PVOID ObjectBody,
161 struct _OBJECT_ATTRIBUTES* ObjectAttributes);
163 VOID STDCALL_FUNC (*DuplicationNotify)(PEPROCESS DuplicateTo,
164 PEPROCESS DuplicateFrom,
170 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
172 #endif /* __USE_W32API */
175 typedef struct _OBJECT_HEADER
177 * PURPOSE: Header for every object managed by the object manager
184 BOOLEAN CloseInProcess;
186 struct _DIRECTORY_OBJECT* Parent;
187 POBJECT_TYPE ObjectType;
190 * PURPOSE: Object type
191 * NOTE: This overlaps the first member of the object body
196 * PURPOSE: Object size
197 * NOTE: This overlaps the second member of the object body
202 } OBJECT_HEADER, *POBJECT_HEADER;
206 typedef struct _OBJECT_ATTRIBUTES
209 HANDLE RootDirectory;
210 PUNICODE_STRING ObjectName;
212 SECURITY_DESCRIPTOR *SecurityDescriptor;
213 SECURITY_QUALITY_OF_SERVICE *SecurityQualityOfService;
214 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
216 #endif /* __USE_W32API */
218 typedef struct _HANDLE_TABLE
226 typedef struct _HANDLE_TABLE *PHANDLE_TABLE;
228 #endif /* __USE_W32API */
230 extern POBJECT_TYPE ObDirectoryType;
232 #endif /* ndef _INCLUDE_DDK_OBTYPES_H */