source: Daodan/MinGW/include/accctrl.h@ 1106

Last change on this file since 1106 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

File size: 11.7 KB
Line 
1#ifndef _ACCCTRL_H
2#define _ACCCTRL_H
3#if __GNUC__ >=3
4#pragma GCC system_header
5#endif
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define AccFree LocalFree
12#define ACTRL_RESERVED 0x00000000
13#define ACTRL_ACCESS_PROTECTED 0x00000001
14#define ACTRL_ACCESS_ALLOWED 0x00000001
15#define ACTRL_ACCESS_DENIED 0x00000002
16#define ACTRL_AUDIT_SUCCESS 0x00000004
17#define ACTRL_AUDIT_FAILURE 0x00000008
18#define ACTRL_SYSTEM_ACCESS 0x04000000
19#define ACTRL_DELETE 0x08000000
20#define ACTRL_READ_CONTROL 0x10000000
21#define ACTRL_CHANGE_ACCESS 0x20000000
22#define ACTRL_CHANGE_OWNER 0x40000000
23#define ACTRL_SYNCHRONIZE 0x80000000
24#define ACTRL_STD_RIGHTS_ALL 0xf8000000
25
26#define ACTRL_FILE_READ 0x00000001
27#define ACTRL_FILE_WRITE 0x00000002
28#define ACTRL_FILE_APPEND 0x00000004
29#define ACTRL_FILE_READ_PROP 0x00000008
30#define ACTRL_FILE_WRITE_PROP 0x00000010
31#define ACTRL_FILE_EXECUTE 0x00000020
32#define ACTRL_FILE_READ_ATTRIB 0x00000080
33#define ACTRL_FILE_WRITE_ATTRIB 0x00000100
34#define ACTRL_FILE_CREATE_PIPE 0x00000200
35#define ACTRL_DIR_LIST 0x00000001
36#define ACTRL_DIR_CREATE_OBJECT 0x00000002
37#define ACTRL_DIR_CREATE_CHILD 0x00000004
38#define ACTRL_DIR_DELETE_CHILD 0x00000040
39#define ACTRL_DIR_TRAVERSE 0x00000020
40#define ACTRL_KERNEL_TERMINATE 0x00000001
41#define ACTRL_KERNEL_THREAD 0x00000002
42#define ACTRL_KERNEL_VM 0x00000004
43#define ACTRL_KERNEL_VM_READ 0x00000008
44#define ACTRL_KERNEL_VM_WRITE 0x00000010
45#define ACTRL_KERNEL_DUP_HANDLE 0x00000020
46#define ACTRL_KERNEL_PROCESS 0x00000040
47#define ACTRL_KERNEL_SET_INFO 0x00000080
48#define ACTRL_KERNEL_GET_INFO 0x00000100
49#define ACTRL_KERNEL_CONTROL 0x00000200
50#define ACTRL_KERNEL_ALERT 0x00000400
51#define ACTRL_KERNEL_GET_CONTEXT 0x00000800
52#define ACTRL_KERNEL_SET_CONTEXT 0x00001000
53#define ACTRL_KERNEL_TOKEN 0x00002000
54#define ACTRL_KERNEL_IMPERSONATE 0x00004000
55#define ACTRL_KERNEL_DIMPERSONATE 0x00008000
56#define ACTRL_PRINT_SADMIN 0x00000001
57#define ACTRL_PRINT_SLIST 0x00000002
58#define ACTRL_PRINT_PADMIN 0x00000004
59#define ACTRL_PRINT_PUSE 0x00000008
60#define ACTRL_PRINT_JADMIN 0x00000010
61#define ACTRL_SVC_GET_INFO 0x00000001
62#define ACTRL_SVC_SET_INFO 0x00000002
63#define ACTRL_SVC_STATUS 0x00000004
64#define ACTRL_SVC_LIST 0x00000008
65#define ACTRL_SVC_START 0x00000010
66#define ACTRL_SVC_STOP 0x00000020
67#define ACTRL_SVC_PAUSE 0x00000040
68#define ACTRL_SVC_INTERROGATE 0x00000080
69#define ACTRL_SVC_UCONTROL 0x00000100
70#define ACTRL_REG_QUERY 0x00000001
71#define ACTRL_REG_SET 0x00000002
72#define ACTRL_REG_CREATE_CHILD 0x00000004
73#define ACTRL_REG_LIST 0x00000008
74#define ACTRL_REG_NOTIFY 0x00000010
75#define ACTRL_REG_LINK 0x00000020
76#define ACTRL_WIN_CLIPBRD 0x00000001
77#define ACTRL_WIN_GLOBAL_ATOMS 0x00000002
78#define ACTRL_WIN_CREATE 0x00000004
79#define ACTRL_WIN_LIST_DESK 0x00000008
80#define ACTRL_WIN_LIST 0x00000010
81#define ACTRL_WIN_READ_ATTRIBS 0x00000020
82#define ACTRL_WIN_WRITE_ATTRIBS 0x00000040
83#define ACTRL_WIN_SCREEN 0x00000080
84#define ACTRL_WIN_EXIT 0x00000100
85#define ACTRL_ACCESS_NO_OPTIONS 0x00000000
86#define ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES 0x00000001
87#define ACCCTRL_DEFAULT_PROVIDERA "Windows NT Access Provider"
88#define ACCCTRL_DEFAULT_PROVIDERW L"Windows NT Access Provider"
89#define TRUSTEE_ACCESS_ALLOWED 0x00000001L
90#define TRUSTEE_ACCESS_READ 0x00000002L
91#define TRUSTEE_ACCESS_WRITE 0x00000004L
92#define TRUSTEE_ACCESS_EXPLICIT 0x00000001L
93#define TRUSTEE_ACCESS_READ_WRITE (TRUSTEE_ACCESS_READ | TRUSTEE_ACCESS_WRITE)
94#define TRUSTEE_ACCESS_ALL 0xFFFFFFFFL
95#define NO_INHERITANCE 0x0
96#define SUB_OBJECTS_ONLY_INHERIT 0x1
97#define SUB_CONTAINERS_ONLY_INHERIT 0x2
98#define SUB_CONTAINERS_AND_OBJECTS_INHERIT 0x3
99#define INHERIT_NO_PROPAGATE 0x4
100#define INHERIT_ONLY 0x8
101#define INHERITED_ACCESS_ENTRY 0x10
102#define INHERITED_PARENT 0x10000000
103#define INHERITED_GRANDPARENT 0x20000000
104
105typedef ULONG INHERIT_FLAGS, *PINHERIT_FLAGS;
106typedef ULONG ACCESS_RIGHTS, *PACCESS_RIGHTS;
107
108typedef enum _ACCESS_MODE {
109 NOT_USED_ACCESS = 0,
110 GRANT_ACCESS,
111 SET_ACCESS,
112 DENY_ACCESS,
113 REVOKE_ACCESS,
114 SET_AUDIT_SUCCESS,
115 SET_AUDIT_FAILURE
116} ACCESS_MODE;
117typedef enum _SE_OBJECT_TYPE {
118 SE_UNKNOWN_OBJECT_TYPE = 0,
119 SE_FILE_OBJECT,
120 SE_SERVICE,
121 SE_PRINTER,
122 SE_REGISTRY_KEY,
123 SE_LMSHARE,
124 SE_KERNEL_OBJECT,
125 SE_WINDOW_OBJECT,
126 SE_DS_OBJECT,
127 SE_DS_OBJECT_ALL,
128 SE_PROVIDER_DEFINED_OBJECT,
129 SE_WMIGUID_OBJECT,
130 SE_REGISTRY_WOW64_32KEY
131} SE_OBJECT_TYPE;
132typedef enum _TRUSTEE_TYPE {
133 TRUSTEE_IS_UNKNOWN,
134 TRUSTEE_IS_USER,
135 TRUSTEE_IS_GROUP,
136 TRUSTEE_IS_DOMAIN,
137 TRUSTEE_IS_ALIAS,
138 TRUSTEE_IS_WELL_KNOWN_GROUP,
139 TRUSTEE_IS_DELETED,
140 TRUSTEE_IS_INVALID,
141 TRUSTEE_IS_COMPUTER
142} TRUSTEE_TYPE;
143typedef enum _TRUSTEE_FORM {
144 TRUSTEE_IS_SID,
145 TRUSTEE_IS_NAME,
146 TRUSTEE_BAD_FORM,
147 TRUSTEE_IS_OBJECTS_AND_SID,
148 TRUSTEE_IS_OBJECTS_AND_NAME
149} TRUSTEE_FORM;
150typedef enum _MULTIPLE_TRUSTEE_OPERATION {
151 NO_MULTIPLE_TRUSTEE,
152 TRUSTEE_IS_IMPERSONATE
153} MULTIPLE_TRUSTEE_OPERATION;
154typedef struct _TRUSTEE_A {
155 struct _TRUSTEE_A *pMultipleTrustee;
156 MULTIPLE_TRUSTEE_OPERATION MultipleTrusteeOperation;
157 TRUSTEE_FORM TrusteeForm;
158 TRUSTEE_TYPE TrusteeType;
159 LPSTR ptstrName;
160} TRUSTEE_A, *PTRUSTEE_A, TRUSTEEA, *PTRUSTEEA;
161typedef struct _TRUSTEE_W {
162 struct _TRUSTEE_W *pMultipleTrustee;
163 MULTIPLE_TRUSTEE_OPERATION MultipleTrusteeOperation;
164 TRUSTEE_FORM TrusteeForm;
165 TRUSTEE_TYPE TrusteeType;
166 LPWSTR ptstrName;
167} TRUSTEE_W, *PTRUSTEE_W, TRUSTEEW, *PTRUSTEEW;
168typedef struct _ACTRL_ACCESS_ENTRYA {
169 TRUSTEE_A Trustee;
170 ULONG fAccessFlags;
171 ACCESS_RIGHTS Access;
172 ACCESS_RIGHTS ProvSpecificAccess;
173 INHERIT_FLAGS Inheritance;
174 LPCSTR lpInheritProperty;
175} ACTRL_ACCESS_ENTRYA, *PACTRL_ACCESS_ENTRYA;
176typedef struct _ACTRL_ACCESS_ENTRYW {
177 TRUSTEE_W Trustee;
178 ULONG fAccessFlags;
179 ACCESS_RIGHTS Access;
180 ACCESS_RIGHTS ProvSpecificAccess;
181 INHERIT_FLAGS Inheritance;
182 LPCWSTR lpInheritProperty;
183} ACTRL_ACCESS_ENTRYW, *PACTRL_ACCESS_ENTRYW;
184typedef struct _ACTRL_ACCESS_ENTRY_LISTA {
185 ULONG cEntries;
186 ACTRL_ACCESS_ENTRYA *pAccessList;
187} ACTRL_ACCESS_ENTRY_LISTA, *PACTRL_ACCESS_ENTRY_LISTA;
188typedef struct _ACTRL_ACCESS_ENTRY_LISTW {
189 ULONG cEntries;
190 ACTRL_ACCESS_ENTRYW *pAccessList;
191} ACTRL_ACCESS_ENTRY_LISTW, *PACTRL_ACCESS_ENTRY_LISTW;
192typedef struct _ACTRL_PROPERTY_ENTRYA {
193 LPCSTR lpProperty;
194 PACTRL_ACCESS_ENTRY_LISTA pAccessEntryList;
195 ULONG fListFlags;
196} ACTRL_PROPERTY_ENTRYA, *PACTRL_PROPERTY_ENTRYA;
197typedef struct _ACTRL_PROPERTY_ENTRYW {
198 LPCWSTR lpProperty;
199 PACTRL_ACCESS_ENTRY_LISTW pAccessEntryList;
200 ULONG fListFlags;
201} ACTRL_PROPERTY_ENTRYW, *PACTRL_PROPERTY_ENTRYW;
202typedef struct _ACTRL_ALISTA {
203 ULONG cEntries;
204 PACTRL_PROPERTY_ENTRYA pPropertyAccessList;
205} ACTRL_ACCESSA, *PACTRL_ACCESSA, ACTRL_AUDITA, *PACTRL_AUDITA;
206typedef struct _ACTRL_ALISTW {
207 ULONG cEntries;
208 PACTRL_PROPERTY_ENTRYW pPropertyAccessList;
209} ACTRL_ACCESSW, *PACTRL_ACCESSW, ACTRL_AUDITW, *PACTRL_AUDITW;
210typedef struct _TRUSTEE_ACCESSA {
211 LPSTR lpProperty;
212 ACCESS_RIGHTS Access;
213 ULONG fAccessFlags;
214 ULONG fReturnedAccess;
215} TRUSTEE_ACCESSA, *PTRUSTEE_ACCESSA;
216typedef struct _TRUSTEE_ACCESSW {
217 LPWSTR lpProperty;
218 ACCESS_RIGHTS Access;
219 ULONG fAccessFlags;
220 ULONG fReturnedAccess;
221} TRUSTEE_ACCESSW, *PTRUSTEE_ACCESSW;
222typedef struct _ACTRL_OVERLAPPED {
223 _ANONYMOUS_UNION
224 union {
225 PVOID Provider;
226 ULONG Reserved1;
227 } DUMMYUNIONNAME;
228 ULONG Reserved2;
229 HANDLE hEvent;
230} ACTRL_OVERLAPPED, *PACTRL_OVERLAPPED;
231typedef struct _ACTRL_ACCESS_INFOA {
232 ULONG fAccessPermission;
233 LPSTR lpAccessPermissionName;
234} ACTRL_ACCESS_INFOA, *PACTRL_ACCESS_INFOA;
235typedef struct _ACTRL_ACCESS_INFOW {
236 ULONG fAccessPermission;
237 LPWSTR lpAccessPermissionName;
238} ACTRL_ACCESS_INFOW, *PACTRL_ACCESS_INFOW;
239typedef struct _ACTRL_CONTROL_INFOA {
240 LPSTR lpControlId;
241 LPSTR lpControlName;
242} ACTRL_CONTROL_INFOA, *PACTRL_CONTROL_INFOA;
243typedef struct _ACTRL_CONTROL_INFOW {
244 LPWSTR lpControlId;
245 LPWSTR lpControlName;
246} ACTRL_CONTROL_INFOW, *PACTRL_CONTROL_INFOW;
247typedef struct _EXPLICIT_ACCESS_A {
248 DWORD grfAccessPermissions;
249 ACCESS_MODE grfAccessMode;
250 DWORD grfInheritance;
251 TRUSTEE_A Trustee;
252} EXPLICIT_ACCESS_A, *PEXPLICIT_ACCESS_A, EXPLICIT_ACCESSA, *PEXPLICIT_ACCESSA;
253typedef struct _EXPLICIT_ACCESS_W {
254 DWORD grfAccessPermissions;
255 ACCESS_MODE grfAccessMode;
256 DWORD grfInheritance;
257 TRUSTEE_W Trustee;
258} EXPLICIT_ACCESS_W, *PEXPLICIT_ACCESS_W, EXPLICIT_ACCESSW, *PEXPLICIT_ACCESSW;
259typedef struct _OBJECTS_AND_SID {
260 DWORD ObjectsPresent;
261 GUID ObjectTypeGuid;
262 GUID InheritedObjectTypeGuid;
263 SID * pSid;
264} OBJECTS_AND_SID, *POBJECTS_AND_SID;
265typedef struct _OBJECTS_AND_NAME_A {
266 DWORD ObjectsPresent;
267 SE_OBJECT_TYPE ObjectType;
268 LPSTR ObjectTypeName;
269 LPSTR InheritedObjectTypeName;
270 LPSTR ptstrName;
271} OBJECTS_AND_NAME_A, *POBJECTS_AND_NAME_A;
272typedef struct _OBJECTS_AND_NAME_W {
273 DWORD ObjectsPresent;
274 SE_OBJECT_TYPE ObjectType;
275 LPWSTR ObjectTypeName;
276 LPWSTR InheritedObjectTypeName;
277 LPWSTR ptstrName;
278} OBJECTS_AND_NAME_W, *POBJECTS_AND_NAME_W;
279#if (_WIN32_WINNT >= 0x0501)
280typedef struct {
281 LONG GenerationGap;
282 LPSTR AncestorName;
283} INHERITED_FROMA, *PINHERITED_FROMA;
284typedef struct {
285 LONG GenerationGap;
286 LPWSTR AncestorName;
287} INHERITED_FROMW, *PINHERITED_FROMW;
288#endif /* (_WIN32_WINNT >= 0x0501) */
289
290#ifdef UNICODE
291#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW
292typedef TRUSTEE_W TRUSTEE_, *PTRUSTEE_;
293typedef TRUSTEEW TRUSTEE, *PTRUSTEE;
294typedef ACTRL_ACCESSW ACTRL_ACCESS, *PACTRL_ACCESS;
295typedef ACTRL_ACCESS_ENTRY_LISTW ACTRL_ACCESS_ENTRY_LIST, *PACTRL_ACCESS_ENTRY_LIST;
296typedef ACTRL_ACCESS_INFOW ACTRL_ACCESS_INFO, *PACTRL_ACCESS_INFO;
297typedef ACTRL_ACCESS_ENTRYW ACTRL_ACCESS_ENTRY, *PACTRL_ACCESS_ENTRY;
298typedef ACTRL_AUDITW ACTRL_AUDIT, *PACTRL_AUDIT;
299typedef ACTRL_CONTROL_INFOW ACTRL_CONTROL_INFO, *PACTRL_CONTROL_INFO;
300typedef EXPLICIT_ACCESS_W EXPLICIT_ACCESS_, *PEXPLICIT_ACCESS_;
301typedef EXPLICIT_ACCESSW EXPLICIT_ACCESS, *PEXPLICIT_ACCESS;
302typedef TRUSTEE_ACCESSW TRUSTEE_ACCESS, *PTRUSTEE_ACCESS;
303typedef OBJECTS_AND_NAME_W OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
304#if (_WIN32_WINNT >= 0x0501)
305typedef INHERITED_FROMW INHERITED_FROM, *PINHERITED_FROM;
306#endif
307#else
308#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERA
309typedef TRUSTEE_A TRUSTEE_, *PTRUSTEE_;
310typedef TRUSTEEA TRUSTEE, *PTRUSTEE;
311typedef ACTRL_ACCESSA ACTRL_ACCESS, *PACTRL_ACCESS;
312typedef ACTRL_ACCESS_ENTRY_LISTA ACTRL_ACCESS_ENTRY_LIST, *PACTRL_ACCESS_ENTRY_LIST;
313typedef ACTRL_ACCESS_INFOA ACTRL_ACCESS_INFO, *PACTRL_ACCESS_INFO;
314typedef ACTRL_ACCESS_ENTRYA ACTRL_ACCESS_ENTRY, *PACTRL_ACCESS_ENTRY;
315typedef ACTRL_AUDITA ACTRL_AUDIT, *PACTRL_AUDIT;
316typedef ACTRL_CONTROL_INFOA ACTRL_CONTROL_INFO, *PACTRL_CONTROL_INFO;
317typedef EXPLICIT_ACCESS_A EXPLICIT_ACCESS_, *PEXPLICIT_ACCESS_;
318typedef EXPLICIT_ACCESSA EXPLICIT_ACCESS, *PEXPLICIT_ACCESS;
319typedef TRUSTEE_ACCESSA TRUSTEE_ACCESS, *PTRUSTEE_ACCESS;
320typedef OBJECTS_AND_NAME_A OBJECTS_AND_NAME_, *POBJECTS_AND_NAME_;
321#if (_WIN32_WINNT >= 0x0501)
322typedef INHERITED_FROMA INHERITED_FROM, *PINHERITED_FROM;
323#endif
324#endif /* UNICODE */
325
326#ifdef __cplusplus
327}
328#endif
329#endif
Note: See TracBrowser for help on using the repository browser.