Add .gitattributes and .gitignore files and normalize line endings in the repository...
[reactos.git] / sdk / include / xdk / obtypes.h
1 /******************************************************************************
2 * Object Manager Types *
3 ******************************************************************************/
4
5 $if (_WDMDDK_)
6 #define MAXIMUM_FILENAME_LENGTH 256
7 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
8
9 #define OBJECT_TYPE_CREATE 0x0001
10 #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
11
12 #define DIRECTORY_QUERY 0x0001
13 #define DIRECTORY_TRAVERSE 0x0002
14 #define DIRECTORY_CREATE_OBJECT 0x0004
15 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008
16 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
17
18 #define SYMBOLIC_LINK_QUERY 0x0001
19 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
20
21 #define DUPLICATE_CLOSE_SOURCE 0x00000001
22 #define DUPLICATE_SAME_ACCESS 0x00000002
23 #define DUPLICATE_SAME_ATTRIBUTES 0x00000004
24
25 #define OB_FLT_REGISTRATION_VERSION_0100 0x0100
26 #define OB_FLT_REGISTRATION_VERSION OB_FLT_REGISTRATION_VERSION_0100
27
28 typedef ULONG OB_OPERATION;
29
30 #define OB_OPERATION_HANDLE_CREATE 0x00000001
31 #define OB_OPERATION_HANDLE_DUPLICATE 0x00000002
32
33 typedef struct _OB_PRE_CREATE_HANDLE_INFORMATION {
34 _Inout_ ACCESS_MASK DesiredAccess;
35 _In_ ACCESS_MASK OriginalDesiredAccess;
36 } OB_PRE_CREATE_HANDLE_INFORMATION, *POB_PRE_CREATE_HANDLE_INFORMATION;
37
38 typedef struct _OB_PRE_DUPLICATE_HANDLE_INFORMATION {
39 _Inout_ ACCESS_MASK DesiredAccess;
40 _In_ ACCESS_MASK OriginalDesiredAccess;
41 _In_ PVOID SourceProcess;
42 _In_ PVOID TargetProcess;
43 } OB_PRE_DUPLICATE_HANDLE_INFORMATION, *POB_PRE_DUPLICATE_HANDLE_INFORMATION;
44
45 typedef union _OB_PRE_OPERATION_PARAMETERS {
46 _Inout_ OB_PRE_CREATE_HANDLE_INFORMATION CreateHandleInformation;
47 _Inout_ OB_PRE_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
48 } OB_PRE_OPERATION_PARAMETERS, *POB_PRE_OPERATION_PARAMETERS;
49
50 typedef struct _OB_PRE_OPERATION_INFORMATION {
51 _In_ OB_OPERATION Operation;
52 _ANONYMOUS_UNION union {
53 _In_ ULONG Flags;
54 _ANONYMOUS_STRUCT struct {
55 _In_ ULONG KernelHandle:1;
56 _In_ ULONG Reserved:31;
57 } DUMMYSTRUCTNAME;
58 } DUMMYUNIONNAME;
59 _In_ PVOID Object;
60 _In_ POBJECT_TYPE ObjectType;
61 _Out_ PVOID CallContext;
62 _In_ POB_PRE_OPERATION_PARAMETERS Parameters;
63 } OB_PRE_OPERATION_INFORMATION, *POB_PRE_OPERATION_INFORMATION;
64
65 typedef struct _OB_POST_CREATE_HANDLE_INFORMATION {
66 _In_ ACCESS_MASK GrantedAccess;
67 } OB_POST_CREATE_HANDLE_INFORMATION, *POB_POST_CREATE_HANDLE_INFORMATION;
68
69 typedef struct _OB_POST_DUPLICATE_HANDLE_INFORMATION {
70 _In_ ACCESS_MASK GrantedAccess;
71 } OB_POST_DUPLICATE_HANDLE_INFORMATION, *POB_POST_DUPLICATE_HANDLE_INFORMATION;
72
73 typedef union _OB_POST_OPERATION_PARAMETERS {
74 _In_ OB_POST_CREATE_HANDLE_INFORMATION CreateHandleInformation;
75 _In_ OB_POST_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation;
76 } OB_POST_OPERATION_PARAMETERS, *POB_POST_OPERATION_PARAMETERS;
77
78 typedef struct _OB_POST_OPERATION_INFORMATION {
79 _In_ OB_OPERATION Operation;
80 _ANONYMOUS_UNION union {
81 _In_ ULONG Flags;
82 _ANONYMOUS_STRUCT struct {
83 _In_ ULONG KernelHandle:1;
84 _In_ ULONG Reserved:31;
85 } DUMMYSTRUCTNAME;
86 } DUMMYUNIONNAME;
87 _In_ PVOID Object;
88 _In_ POBJECT_TYPE ObjectType;
89 _In_ PVOID CallContext;
90 _In_ NTSTATUS ReturnStatus;
91 _In_ POB_POST_OPERATION_PARAMETERS Parameters;
92 } OB_POST_OPERATION_INFORMATION,*POB_POST_OPERATION_INFORMATION;
93
94 typedef enum _OB_PREOP_CALLBACK_STATUS {
95 OB_PREOP_SUCCESS
96 } OB_PREOP_CALLBACK_STATUS, *POB_PREOP_CALLBACK_STATUS;
97
98 typedef OB_PREOP_CALLBACK_STATUS
99 (NTAPI *POB_PRE_OPERATION_CALLBACK)(
100 _In_ PVOID RegistrationContext,
101 _Inout_ POB_PRE_OPERATION_INFORMATION OperationInformation);
102
103 typedef VOID
104 (NTAPI *POB_POST_OPERATION_CALLBACK)(
105 _In_ PVOID RegistrationContext,
106 _In_ POB_POST_OPERATION_INFORMATION OperationInformation);
107
108 typedef struct _OB_OPERATION_REGISTRATION {
109 _In_ POBJECT_TYPE *ObjectType;
110 _In_ OB_OPERATION Operations;
111 _In_ POB_PRE_OPERATION_CALLBACK PreOperation;
112 _In_ POB_POST_OPERATION_CALLBACK PostOperation;
113 } OB_OPERATION_REGISTRATION, *POB_OPERATION_REGISTRATION;
114
115 typedef struct _OB_CALLBACK_REGISTRATION {
116 _In_ USHORT Version;
117 _In_ USHORT OperationRegistrationCount;
118 _In_ UNICODE_STRING Altitude;
119 _In_ PVOID RegistrationContext;
120 _In_ OB_OPERATION_REGISTRATION *OperationRegistration;
121 } OB_CALLBACK_REGISTRATION, *POB_CALLBACK_REGISTRATION;
122
123 typedef struct _OBJECT_NAME_INFORMATION {
124 UNICODE_STRING Name;
125 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
126
127 /* Exported object types */
128 #ifdef _NTSYSTEM_
129 extern POBJECT_TYPE NTSYSAPI CmKeyObjectType;
130 extern POBJECT_TYPE NTSYSAPI ExEventObjectType;
131 extern POBJECT_TYPE NTSYSAPI ExSemaphoreObjectType;
132 extern POBJECT_TYPE NTSYSAPI IoFileObjectType;
133 extern POBJECT_TYPE NTSYSAPI PsThreadType;
134 extern POBJECT_TYPE NTSYSAPI SeTokenObjectType;
135 extern POBJECT_TYPE NTSYSAPI PsProcessType;
136 #else
137 __CREATE_NTOS_DATA_IMPORT_ALIAS(CmKeyObjectType)
138 __CREATE_NTOS_DATA_IMPORT_ALIAS(IoFileObjectType)
139 __CREATE_NTOS_DATA_IMPORT_ALIAS(ExEventObjectType)
140 __CREATE_NTOS_DATA_IMPORT_ALIAS(ExSemaphoreObjectType)
141 __CREATE_NTOS_DATA_IMPORT_ALIAS(TmTransactionManagerObjectType)
142 __CREATE_NTOS_DATA_IMPORT_ALIAS(TmResourceManagerObjectType)
143 __CREATE_NTOS_DATA_IMPORT_ALIAS(TmEnlistmentObjectType)
144 __CREATE_NTOS_DATA_IMPORT_ALIAS(TmTransactionObjectType)
145 __CREATE_NTOS_DATA_IMPORT_ALIAS(PsProcessType)
146 __CREATE_NTOS_DATA_IMPORT_ALIAS(PsThreadType)
147 __CREATE_NTOS_DATA_IMPORT_ALIAS(SeTokenObjectType)
148 extern POBJECT_TYPE *CmKeyObjectType;
149 extern POBJECT_TYPE *IoFileObjectType;
150 extern POBJECT_TYPE *ExEventObjectType;
151 extern POBJECT_TYPE *ExSemaphoreObjectType;
152 extern POBJECT_TYPE *TmTransactionManagerObjectType;
153 extern POBJECT_TYPE *TmResourceManagerObjectType;
154 extern POBJECT_TYPE *TmEnlistmentObjectType;
155 extern POBJECT_TYPE *TmTransactionObjectType;
156 extern POBJECT_TYPE *PsProcessType;
157 extern POBJECT_TYPE *PsThreadType;
158 extern POBJECT_TYPE *SeTokenObjectType;
159 #endif
160
161 $endif (_WDMDDK_)
162 $if (_NTIFS_)
163 typedef enum _OBJECT_INFORMATION_CLASS {
164 ObjectBasicInformation = 0,
165 ObjectTypeInformation = 2,
166 $endif (_NTIFS_)
167 $if (_NTIFS_) // we should remove these, but the kernel needs them :-/
168 /* Not for public use */
169 ObjectNameInformation = 1,
170 ObjectTypesInformation = 3,
171 ObjectHandleFlagInformation = 4,
172 ObjectSessionInformation = 5,
173 MaxObjectInfoClass
174 $endif (_NTIFS_)
175 $if (_NTIFS_)
176 } OBJECT_INFORMATION_CLASS;
177
178 $endif (_NTIFS_)
179