24074ccde1bb8818a97e64b27a22e48399518987
[tprouty/samba.git] / source / include / rpc_secdes.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell              1992-2000
5    Copyright (C) Luke Kenneth Casson Leighton 1996-2000
6    
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
23 #define _RPC_SECDES_H 
24
25 /* for ADS */
26 #define SEC_RIGHTS_LIST_CONTENTS        0x4
27 #define SEC_RIGHTS_LIST_OBJECT          0x80
28 #define SEC_RIGHTS_READ_ALL_PROP        0x10
29 #define SEC_RIGHTS_READ_PERMS           0x20000
30 #define SEC_RIGHTS_WRITE_ALL_VALID      0x8
31 #define SEC_RIGHTS_WRITE_ALL_PROP       0x20     
32 #define SEC_RIGHTS_MODIFY_OWNER         0x80000
33 #define SEC_RIGHTS_MODIFY_PERMS         0x40000
34 #define SEC_RIGHTS_CREATE_CHILD         0x1
35 #define SEC_RIGHTS_DELETE_CHILD         0x2
36 #define SEC_RIGHTS_DELETE_SUBTREE       0x40
37 #define SEC_RIGHTS_DELETE               0x10000 /* advanced/special/object/delete */
38 #define SEC_RIGHTS_EXTENDED             0x100 /* change/reset password, receive/send as*/
39 #define SEC_RIGHTS_CHANGE_PASSWD        SEC_RIGHTS_EXTENDED
40 #define SEC_RIGHTS_RESET_PASSWD         SEC_RIGHTS_EXTENDED
41 #define SEC_RIGHTS_APPLY_GROUP_POLICY   SEC_RIGHTS_EXTENDED
42 #define SEC_RIGHTS_FULL_CTRL            0xf01ff
43
44 #define SEC_ACE_OBJECT_PRESENT           0x00000001 /* thanks for Jim McDonough <jmcd@us.ibm.com> */
45 #define SEC_ACE_OBJECT_INHERITED_PRESENT 0x00000002
46
47 /*
48  * New Windows 2000 bits.
49  */
50 #define SE_DESC_DACL_AUTO_INHERIT_REQ   0x0100
51 #define SE_DESC_SACL_AUTO_INHERIT_REQ   0x0200
52 #define SE_DESC_DACL_AUTO_INHERITED     0x0400
53 #define SE_DESC_SACL_AUTO_INHERITED     0x0800
54 #define SE_DESC_DACL_PROTECTED          0x1000
55 #define SE_DESC_SACL_PROTECTED          0x2000
56
57 /* security information */
58 #define OWNER_SECURITY_INFORMATION      0x00000001
59 #define GROUP_SECURITY_INFORMATION      0x00000002
60 #define DACL_SECURITY_INFORMATION       0x00000004
61 #define SACL_SECURITY_INFORMATION       0x00000008
62 /* Extra W2K flags. */
63 #define UNPROTECTED_SACL_SECURITY_INFORMATION   0x10000000
64 #define UNPROTECTED_DACL_SECURITY_INFORMATION   0x20000000
65 #define PROTECTED_SACL_SECURITY_INFORMATION     0x40000000
66 #define PROTECTED_DACL_SECURITY_INFORMATION     0x80000000
67
68 #define ALL_SECURITY_INFORMATION (OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|\
69                                         DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION|\
70                                         UNPROTECTED_SACL_SECURITY_INFORMATION|\
71                                         UNPROTECTED_DACL_SECURITY_INFORMATION|\
72                                         PROTECTED_SACL_SECURITY_INFORMATION|\
73                                         PROTECTED_DACL_SECURITY_INFORMATION)
74
75 /* SEC_ACCESS */
76 typedef uint32 SEC_ACCESS;
77
78 /* SEC_ACE */
79 typedef struct security_ace SEC_ACE;
80 #define  SEC_ACE_HEADER_SIZE (2 * sizeof(uint8) + sizeof(uint16) + sizeof(uint32))
81
82 #ifndef ACL_REVISION
83 #define ACL_REVISION 0x3
84 #endif
85
86 #ifndef _SEC_ACL
87 /* SEC_ACL */
88 typedef struct security_acl SEC_ACL;
89 #define  SEC_ACL_HEADER_SIZE (2 * sizeof(uint16) + sizeof(uint32))
90 #define _SEC_ACL
91 #endif
92
93 #ifndef SEC_DESC_REVISION
94 #define SEC_DESC_REVISION 0x1
95 #endif
96
97 #ifndef _SEC_DESC
98 /* SEC_DESC */
99 typedef struct security_descriptor SEC_DESC;
100 #define  SEC_DESC_HEADER_SIZE (2 * sizeof(uint16) + 4 * sizeof(uint32))
101 #define _SEC_DESC
102 #endif
103
104 #ifndef _SEC_DESC_BUF
105 /* SEC_DESC_BUF */
106 typedef struct sec_desc_buf SEC_DESC_BUF;
107 #define _SEC_DESC_BUF
108 #endif
109
110 /* A type to describe the mapping of generic access rights to object
111    specific access rights. */
112
113 typedef struct generic_mapping {
114         uint32 generic_read;
115         uint32 generic_write;
116         uint32 generic_execute;
117         uint32 generic_all;
118 } GENERIC_MAPPING;
119
120 typedef struct standard_mapping {
121         uint32 std_read;
122         uint32 std_write;
123         uint32 std_execute;
124         uint32 std_all;
125 } STANDARD_MAPPING;
126
127
128 /* Security Access Masks Rights */
129
130 #define SPECIFIC_RIGHTS_MASK    0x0000FFFF
131 #define STANDARD_RIGHTS_MASK    0x00FF0000
132 #define GENERIC_RIGHTS_MASK     0xF0000000
133
134 #define SEC_RIGHT_SYSTEM_SECURITY       0x01000000
135 #define SEC_RIGHT_MAXIMUM_ALLOWED       0x02000000
136
137 /* Generic access rights */
138
139 #define GENERIC_RIGHT_ALL_ACCESS        0x10000000
140 #define GENERIC_RIGHT_EXECUTE_ACCESS    0x20000000
141 #define GENERIC_RIGHT_WRITE_ACCESS      0x40000000
142 #define GENERIC_RIGHT_READ_ACCESS       0x80000000
143
144 /* Standard access rights. */
145
146 #define STD_RIGHT_DELETE_ACCESS         0x00010000
147 #define STD_RIGHT_READ_CONTROL_ACCESS   0x00020000
148 #define STD_RIGHT_WRITE_DAC_ACCESS      0x00040000
149 #define STD_RIGHT_WRITE_OWNER_ACCESS    0x00080000
150 #define STD_RIGHT_SYNCHRONIZE_ACCESS    0x00100000
151
152 #define STD_RIGHT_ALL_ACCESS            0x001F0000
153
154 /* Combinations of standard masks. */
155 #define STANDARD_RIGHTS_ALL_ACCESS      STD_RIGHT_ALL_ACCESS /* 0x001f0000 */
156 #define STANDARD_RIGHTS_MODIFY_ACCESS   STD_RIGHT_READ_CONTROL_ACCESS /* 0x00020000 */
157 #define STANDARD_RIGHTS_EXECUTE_ACCESS  STD_RIGHT_READ_CONTROL_ACCESS /* 0x00020000 */
158 #define STANDARD_RIGHTS_READ_ACCESS     STD_RIGHT_READ_CONTROL_ACCESS /* 0x00020000 */
159 #define STANDARD_RIGHTS_WRITE_ACCESS \
160                 (STD_RIGHT_WRITE_OWNER_ACCESS   | \
161                  STD_RIGHT_WRITE_DAC_ACCESS     | \
162                  STD_RIGHT_DELETE_ACCESS)       /* 0x000d0000 */
163 #define STANDARD_RIGHTS_REQUIRED_ACCESS \
164                 (STD_RIGHT_DELETE_ACCESS        | \
165                 STD_RIGHT_READ_CONTROL_ACCESS   | \
166                 STD_RIGHT_WRITE_DAC_ACCESS      | \
167                 STD_RIGHT_WRITE_OWNER_ACCESS)   /* 0x000f0000 */
168
169 /* File Object specific access rights */
170
171 #define SA_RIGHT_FILE_READ_DATA         0x00000001
172 #define SA_RIGHT_FILE_WRITE_DATA        0x00000002
173 #define SA_RIGHT_FILE_APPEND_DATA       0x00000004
174 #define SA_RIGHT_FILE_READ_EA           0x00000008
175 #define SA_RIGHT_FILE_WRITE_EA          0x00000010
176 #define SA_RIGHT_FILE_EXECUTE           0x00000020
177 #define SA_RIGHT_FILE_DELETE_CHILD      0x00000040
178 #define SA_RIGHT_FILE_READ_ATTRIBUTES   0x00000080
179 #define SA_RIGHT_FILE_WRITE_ATTRIBUTES  0x00000100
180
181 #define SA_RIGHT_FILE_ALL_ACCESS        0x000001FF
182
183 #define GENERIC_RIGHTS_FILE_ALL_ACCESS \
184                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
185                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
186                 SA_RIGHT_FILE_ALL_ACCESS)
187
188 #define GENERIC_RIGHTS_FILE_READ        \
189                 (STANDARD_RIGHTS_READ_ACCESS    | \
190                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
191                 SA_RIGHT_FILE_READ_DATA         | \
192                 SA_RIGHT_FILE_READ_ATTRIBUTES   | \
193                 SA_RIGHT_FILE_READ_EA)
194
195 #define GENERIC_RIGHTS_FILE_WRITE \
196                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
197                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
198                 SA_RIGHT_FILE_WRITE_DATA        | \
199                 SA_RIGHT_FILE_WRITE_ATTRIBUTES  | \
200                 SA_RIGHT_FILE_WRITE_EA          | \
201                 SA_RIGHT_FILE_APPEND_DATA)
202
203 #define GENERIC_RIGHTS_FILE_EXECUTE \
204                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
205                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
206                 SA_RIGHT_FILE_READ_ATTRIBUTES   | \
207                 SA_RIGHT_FILE_EXECUTE)            
208
209 #define GENERIC_RIGHTS_FILE_MODIFY \
210                 (STANDARD_RIGHTS_MODIFY_ACCESS  | \
211                 STD_RIGHT_SYNCHRONIZE_ACCESS    | \
212                 STD_RIGHT_DELETE_ACCESS         | \
213                 SA_RIGHT_FILE_WRITE_ATTRIBUTES  | \
214                 SA_RIGHT_FILE_READ_ATTRIBUTES   | \
215                 SA_RIGHT_FILE_EXECUTE           | \
216                 SA_RIGHT_FILE_WRITE_EA          | \
217                 SA_RIGHT_FILE_READ_EA           | \
218                 SA_RIGHT_FILE_APPEND_DATA       | \
219                 SA_RIGHT_FILE_WRITE_DATA        | \
220                 SA_RIGHT_FILE_READ_DATA)
221
222 /* SAM server specific access rights */
223
224 #define SA_RIGHT_SAM_CONNECT_SERVER     0x00000001
225 #define SA_RIGHT_SAM_SHUTDOWN_SERVER    0x00000002
226 #define SA_RIGHT_SAM_INITIALISE_SERVER  0x00000004
227 #define SA_RIGHT_SAM_CREATE_DOMAIN      0x00000008
228 #define SA_RIGHT_SAM_ENUM_DOMAINS       0x00000010
229 #define SA_RIGHT_SAM_OPEN_DOMAIN        0x00000020
230
231 #define SA_RIGHT_SAM_ALL_ACCESS         0x0000003F
232
233 #define GENERIC_RIGHTS_SAM_ALL_ACCESS \
234                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
235                 SA_RIGHT_SAM_ALL_ACCESS)
236
237 #define GENERIC_RIGHTS_SAM_READ \
238                 (STANDARD_RIGHTS_READ_ACCESS    | \
239                 SA_RIGHT_SAM_ENUM_DOMAINS)
240
241 #define GENERIC_RIGHTS_SAM_WRITE \
242                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
243                 SA_RIGHT_SAM_CREATE_DOMAIN      | \
244                 SA_RIGHT_SAM_INITIALISE_SERVER  | \
245                 SA_RIGHT_SAM_SHUTDOWN_SERVER)
246
247 #define GENERIC_RIGHTS_SAM_EXECUTE \
248                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
249                 SA_RIGHT_SAM_OPEN_DOMAIN        | \
250                 SA_RIGHT_SAM_CONNECT_SERVER)            
251
252
253 /* Domain Object specific access rights */
254
255 #define SA_RIGHT_DOMAIN_LOOKUP_INFO_1           0x00000001
256 #define SA_RIGHT_DOMAIN_SET_INFO_1              0x00000002
257 #define SA_RIGHT_DOMAIN_LOOKUP_INFO_2           0x00000004
258 #define SA_RIGHT_DOMAIN_SET_INFO_2              0x00000008
259 #define SA_RIGHT_DOMAIN_CREATE_USER             0x00000010
260 #define SA_RIGHT_DOMAIN_CREATE_GROUP            0x00000020
261 #define SA_RIGHT_DOMAIN_CREATE_ALIAS            0x00000040
262 #define SA_RIGHT_DOMAIN_LOOKUP_ALIAS_BY_MEM     0x00000080
263 #define SA_RIGHT_DOMAIN_ENUM_ACCOUNTS           0x00000100
264 #define SA_RIGHT_DOMAIN_OPEN_ACCOUNT            0x00000200
265 #define SA_RIGHT_DOMAIN_SET_INFO_3              0x00000400
266
267 #define SA_RIGHT_DOMAIN_ALL_ACCESS              0x000007FF
268
269 #define GENERIC_RIGHTS_DOMAIN_ALL_ACCESS \
270                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
271                 SA_RIGHT_DOMAIN_ALL_ACCESS)
272
273 #define GENERIC_RIGHTS_DOMAIN_READ \
274                 (STANDARD_RIGHTS_READ_ACCESS            | \
275                 SA_RIGHT_DOMAIN_LOOKUP_ALIAS_BY_MEM     | \
276                 SA_RIGHT_DOMAIN_LOOKUP_INFO_2)
277
278 #define GENERIC_RIGHTS_DOMAIN_WRITE \
279                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
280                 SA_RIGHT_DOMAIN_SET_INFO_3      | \
281                 SA_RIGHT_DOMAIN_CREATE_ALIAS    | \
282                 SA_RIGHT_DOMAIN_CREATE_GROUP    | \
283                 SA_RIGHT_DOMAIN_CREATE_USER     | \
284                 SA_RIGHT_DOMAIN_SET_INFO_2      | \
285                 SA_RIGHT_DOMAIN_SET_INFO_1)
286
287 #define GENERIC_RIGHTS_DOMAIN_EXECUTE \
288                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
289                 SA_RIGHT_DOMAIN_OPEN_ACCOUNT    | \
290                 SA_RIGHT_DOMAIN_ENUM_ACCOUNTS   | \
291                 SA_RIGHT_DOMAIN_LOOKUP_INFO_1)            
292
293
294 /* User Object specific access rights */
295
296 #define SA_RIGHT_USER_GET_NAME_ETC      0x00000001
297 #define SA_RIGHT_USER_GET_LOCALE        0x00000002
298 #define SA_RIGHT_USER_SET_LOC_COM       0x00000004
299 #define SA_RIGHT_USER_GET_LOGONINFO     0x00000008
300 #define SA_RIGHT_USER_ACCT_FLAGS_EXPIRY 0x00000010
301 #define SA_RIGHT_USER_SET_ATTRIBUTES    0x00000020
302 #define SA_RIGHT_USER_CHANGE_PASSWORD   0x00000040
303 #define SA_RIGHT_USER_SET_PASSWORD      0x00000080
304 #define SA_RIGHT_USER_GET_GROUPS        0x00000100
305 #define SA_RIGHT_USER_READ_GROUP_MEM    0x00000200
306 #define SA_RIGHT_USER_CHANGE_GROUP_MEM  0x00000400
307
308 #define SA_RIGHT_USER_ALL_ACCESS        0x000007FF
309
310 #define GENERIC_RIGHTS_USER_ALL_ACCESS \
311                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
312                 SA_RIGHT_USER_ALL_ACCESS)       /* 0x000f07ff */
313
314 #define GENERIC_RIGHTS_USER_READ \
315                 (STANDARD_RIGHTS_READ_ACCESS    | \
316                 SA_RIGHT_USER_READ_GROUP_MEM    | \
317                 SA_RIGHT_USER_GET_GROUPS        | \
318                 SA_RIGHT_USER_ACCT_FLAGS_EXPIRY | \
319                 SA_RIGHT_USER_GET_LOGONINFO     | \
320                 SA_RIGHT_USER_GET_LOCALE)       /* 0x0002031a */
321
322 #define GENERIC_RIGHTS_USER_WRITE \
323                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
324                 SA_RIGHT_USER_CHANGE_PASSWORD   | \
325                 SA_RIGHT_USER_SET_LOC_COM       | \
326                 SA_RIGHT_USER_SET_ATTRIBUTES    | \
327                 SA_RIGHT_USER_SET_PASSWORD      | \
328                 SA_RIGHT_USER_CHANGE_GROUP_MEM) /* 0x000204e4 */
329
330 #define GENERIC_RIGHTS_USER_EXECUTE \
331                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
332                 SA_RIGHT_USER_CHANGE_PASSWORD   | \
333                 SA_RIGHT_USER_GET_NAME_ETC )    /* 0x00020041 */
334
335
336 /* Group Object specific access rights */
337
338 #define SA_RIGHT_GROUP_LOOKUP_INFO      0x00000001
339 #define SA_RIGHT_GROUP_SET_INFO         0x00000002
340 #define SA_RIGHT_GROUP_ADD_MEMBER       0x00000004
341 #define SA_RIGHT_GROUP_REMOVE_MEMBER    0x00000008
342 #define SA_RIGHT_GROUP_GET_MEMBERS      0x00000010
343
344 #define SA_RIGHT_GROUP_ALL_ACCESS       0x0000001F
345
346 #define GENERIC_RIGHTS_GROUP_ALL_ACCESS \
347                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
348                 SA_RIGHT_GROUP_ALL_ACCESS)      /* 0x000f001f */
349
350 #define GENERIC_RIGHTS_GROUP_READ \
351                 (STANDARD_RIGHTS_READ_ACCESS    | \
352                 SA_RIGHT_GROUP_GET_MEMBERS)     /* 0x00020010 */
353
354 #define GENERIC_RIGHTS_GROUP_WRITE \
355                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
356                 SA_RIGHT_GROUP_REMOVE_MEMBER    | \
357                 SA_RIGHT_GROUP_ADD_MEMBER       | \
358                 SA_RIGHT_GROUP_SET_INFO )       /* 0x0002000e */
359
360 #define GENERIC_RIGHTS_GROUP_EXECUTE \
361                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
362                 SA_RIGHT_GROUP_LOOKUP_INFO)     /* 0x00020001 */
363
364
365 /* Alias Object specific access rights */
366
367 #define SA_RIGHT_ALIAS_ADD_MEMBER       0x00000001
368 #define SA_RIGHT_ALIAS_REMOVE_MEMBER    0x00000002
369 #define SA_RIGHT_ALIAS_GET_MEMBERS      0x00000004
370 #define SA_RIGHT_ALIAS_LOOKUP_INFO      0x00000008
371 #define SA_RIGHT_ALIAS_SET_INFO         0x00000010
372
373 #define SA_RIGHT_ALIAS_ALL_ACCESS       0x0000001F
374
375 #define GENERIC_RIGHTS_ALIAS_ALL_ACCESS \
376                 (STANDARD_RIGHTS_REQUIRED_ACCESS| \
377                 SA_RIGHT_ALIAS_ALL_ACCESS)      /* 0x000f001f */
378
379 #define GENERIC_RIGHTS_ALIAS_READ \
380                 (STANDARD_RIGHTS_READ_ACCESS    | \
381                 SA_RIGHT_ALIAS_GET_MEMBERS )    /* 0x00020004 */
382
383 #define GENERIC_RIGHTS_ALIAS_WRITE \
384                 (STANDARD_RIGHTS_WRITE_ACCESS   | \
385                 SA_RIGHT_ALIAS_REMOVE_MEMBER    | \
386                 SA_RIGHT_ALIAS_ADD_MEMBER       | \
387                 SA_RIGHT_ALIAS_SET_INFO )       /* 0x00020013 */
388
389 #define GENERIC_RIGHTS_ALIAS_EXECUTE \
390                 (STANDARD_RIGHTS_EXECUTE_ACCESS | \
391                 SA_RIGHT_ALIAS_LOOKUP_INFO )    /* 0x00020008 */
392
393 /*
394  * Acces bits for the svcctl objects
395  */
396
397 /* Service Control Manager Bits */ 
398
399 #define SC_RIGHT_MGR_CONNECT                    0x0001
400 #define SC_RIGHT_MGR_CREATE_SERVICE             0x0002
401 #define SC_RIGHT_MGR_ENUMERATE_SERVICE          0x0004
402 #define SC_RIGHT_MGR_LOCK                       0x0008
403 #define SC_RIGHT_MGR_QUERY_LOCK_STATUS          0x0010
404 #define SC_RIGHT_MGR_MODIFY_BOOT_CONFIG         0x0020
405
406 #define SC_MANAGER_READ_ACCESS \
407         ( STANDARD_RIGHTS_READ_ACCESS           | \
408           SC_RIGHT_MGR_CONNECT                  | \
409           SC_RIGHT_MGR_ENUMERATE_SERVICE        | \
410           SC_RIGHT_MGR_QUERY_LOCK_STATUS )
411
412 #define SC_MANAGER_EXECUTE_ACCESS SC_MANAGER_READ_ACCESS
413
414 #define SC_MANAGER_WRITE_ACCESS \
415         ( STANDARD_RIGHTS_REQUIRED_ACCESS       | \
416           SC_MANAGER_READ_ACCESS                | \
417           SC_RIGHT_MGR_CREATE_SERVICE           | \
418           SC_RIGHT_MGR_LOCK                     | \
419           SC_RIGHT_MGR_MODIFY_BOOT_CONFIG )
420
421 #define SC_MANAGER_ALL_ACCESS SC_MANAGER_WRITE_ACCESS
422
423 /* Service Object Bits */ 
424
425 #define SC_RIGHT_SVC_QUERY_CONFIG               0x0001
426 #define SC_RIGHT_SVC_CHANGE_CONFIG              0x0002
427 #define SC_RIGHT_SVC_QUERY_STATUS               0x0004
428 #define SC_RIGHT_SVC_ENUMERATE_DEPENDENTS       0x0008
429 #define SC_RIGHT_SVC_START                      0x0010
430 #define SC_RIGHT_SVC_STOP                       0x0020
431 #define SC_RIGHT_SVC_PAUSE_CONTINUE             0x0040
432 #define SC_RIGHT_SVC_INTERROGATE                0x0080
433 #define SC_RIGHT_SVC_USER_DEFINED_CONTROL       0x0100
434
435 #define SERVICE_READ_ACCESS \
436         ( STANDARD_RIGHTS_READ_ACCESS           | \
437           SC_RIGHT_SVC_ENUMERATE_DEPENDENTS     | \
438           SC_RIGHT_SVC_INTERROGATE              | \
439           SC_RIGHT_SVC_QUERY_CONFIG             | \
440           SC_RIGHT_SVC_QUERY_STATUS             | \
441           SC_RIGHT_SVC_USER_DEFINED_CONTROL )
442
443 #define SERVICE_EXECUTE_ACCESS \
444         ( SERVICE_READ_ACCESS                   | \
445           SC_RIGHT_SVC_START                    | \
446           SC_RIGHT_SVC_STOP                     | \
447           SC_RIGHT_SVC_PAUSE_CONTINUE )
448
449 #define SERVICE_WRITE_ACCESS \
450         ( STANDARD_RIGHTS_REQUIRED_ACCESS       | \
451           SERVICE_READ_ACCESS                   | \
452           SERVICE_EXECUTE_ACCESS                | \
453           SC_RIGHT_SVC_CHANGE_CONFIG )
454
455 #define SERVICE_ALL_ACCESS SERVICE_WRITE_ACCESS
456
457            
458
459 /*
460  * Access Bits for registry ACLS
461  */
462
463 /* used by registry ACLs */
464
465 #define SEC_RIGHTS_QUERY_VALUE          0x00000001
466 #define SEC_RIGHTS_SET_VALUE            0x00000002
467 #define SEC_RIGHTS_CREATE_SUBKEY        0x00000004
468 #define SEC_RIGHTS_ENUM_SUBKEYS         0x00000008
469 #define SEC_RIGHTS_NOTIFY               0x00000010
470 #define SEC_RIGHTS_CREATE_LINK          0x00000020
471 #define SEC_RIGHTS_MAXIMUM_ALLOWED      0x02000000
472
473
474 #define REG_KEY_READ \
475         ( STANDARD_RIGHTS_READ_ACCESS           |\
476           SEC_RIGHTS_QUERY_VALUE                |\
477           SEC_RIGHTS_ENUM_SUBKEYS               |\
478           SEC_RIGHTS_NOTIFY )
479           
480 #define REG_KEY_EXECUTE REG_KEY_READ
481
482 #define REG_KEY_WRITE \
483         ( STANDARD_RIGHTS_WRITE_ACCESS          |\
484           SEC_RIGHTS_SET_VALUE                  |\
485           SEC_RIGHTS_CREATE_SUBKEY )
486
487 #define REG_KEY_ALL \
488         ( STANDARD_RIGHTS_REQUIRED_ACCESS       |\
489           REG_KEY_READ                          |\
490           REG_KEY_WRITE                         |\
491           SEC_RIGHTS_CREATE_LINK )
492
493
494 #endif /* _RPC_SECDES_H */