902d1e20b236bb3134931346662cc10b0451150e
[samba.git] / source3 / include / rpc_lsa.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell               1992-1997
5    Copyright (C) Luke Kenneth Casson Leighton  1996-1997
6    Copyright (C) Paul Ashton                   1997
7    Copyright (C) Gerald (Jerry) Carter         2005
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 */
22
23 #ifndef _RPC_LSA_H /* _RPC_LSA_H */
24 #define _RPC_LSA_H 
25
26 /* Opcodes available on PIPE_LSARPC */
27
28 #define LSA_CLOSE              0x00
29 #define LSA_DELETE             0x01
30 #define LSA_ENUM_PRIVS         0x02
31 #define LSA_QUERYSECOBJ        0x03
32 #define LSA_SETSECOBJ          0x04
33 #define LSA_CHANGEPASSWORD     0x05
34 #define LSA_OPENPOLICY         0x06
35 #define LSA_QUERYINFOPOLICY    0x07
36 #define LSA_SETINFOPOLICY      0x08
37 #define LSA_CLEARAUDITLOG      0x09
38 #define LSA_CREATEACCOUNT      0x0a
39 #define LSA_ENUM_ACCOUNTS      0x0b
40 #define LSA_CREATETRUSTDOM     0x0c     /* TODO: implement this one  -- jerry */
41 #define LSA_ENUMTRUSTDOM       0x0d
42 #define LSA_LOOKUPNAMES        0x0e
43 #define LSA_LOOKUPSIDS         0x0f
44 #define LSA_CREATESECRET       0x10     /* TODO: implement this one  -- jerry */
45 #define LSA_OPENACCOUNT        0x11
46 #define LSA_ENUMPRIVSACCOUNT   0x12
47 #define LSA_ADDPRIVS           0x13
48 #define LSA_REMOVEPRIVS        0x14
49 #define LSA_GETQUOTAS          0x15
50 #define LSA_SETQUOTAS          0x16
51 #define LSA_GETSYSTEMACCOUNT   0x17
52 #define LSA_SETSYSTEMACCOUNT   0x18
53 #define LSA_OPENTRUSTDOM       0x19
54 #define LSA_QUERYTRUSTDOMINFO  0x1a
55 #define LSA_SETINFOTRUSTDOM    0x1b
56 #define LSA_OPENSECRET         0x1c     /* TODO: implement this one  -- jerry */
57 #define LSA_SETSECRET          0x1d     /* TODO: implement this one  -- jerry */
58 #define LSA_QUERYSECRET        0x1e
59 #define LSA_LOOKUPPRIVVALUE    0x1f
60 #define LSA_LOOKUPPRIVNAME     0x20
61 #define LSA_PRIV_GET_DISPNAME  0x21
62 #define LSA_DELETEOBJECT       0x22     /* TODO: implement this one  -- jerry */
63 #define LSA_ENUMACCTWITHRIGHT  0x23     /* TODO: implement this one  -- jerry */
64 #define LSA_ENUMACCTRIGHTS     0x24
65 #define LSA_ADDACCTRIGHTS      0x25
66 #define LSA_REMOVEACCTRIGHTS   0x26
67 #define LSA_QUERYTRUSTDOMINFOBYSID  0x27
68 #define LSA_SETTRUSTDOMINFO    0x28
69 #define LSA_DELETETRUSTDOM     0x29
70 #define LSA_STOREPRIVDATA      0x2a
71 #define LSA_RETRPRIVDATA       0x2b
72 #define LSA_OPENPOLICY2        0x2c
73 #define LSA_UNK_GET_CONNUSER   0x2d /* LsaGetConnectedCredentials ? */
74 #define LSA_QUERYINFO2         0x2e
75 #define LSA_QUERYTRUSTDOMINFOBYNAME 0x30
76 #define LSA_QUERYDOMINFOPOL    0x35
77 #define LSA_OPENTRUSTDOMBYNAME 0x37
78
79 #define LSA_LOOKUPSIDS2        0x39
80 #define LSA_LOOKUPNAMES2       0x3a
81 #define LSA_LOOKUPNAMES3       0x44
82 #define LSA_LOOKUPSIDS3        0x4c
83 #define LSA_LOOKUPNAMES4       0x4d
84
85 /* XXXX these are here to get a compile! */
86 #define LSA_LOOKUPRIDS      0xFD
87
88 #define LSA_AUDIT_NUM_CATEGORIES_NT4    7
89 #define LSA_AUDIT_NUM_CATEGORIES_WIN2K  9
90 #define LSA_AUDIT_NUM_CATEGORIES LSA_AUDIT_NUM_CATEGORIES_NT4
91
92 typedef struct seq_qos_info
93 {
94         uint32 len; /* 12 */
95         uint16 sec_imp_level; /* 0x02 - impersonation level */
96         uint8  sec_ctxt_mode; /* 0x01 - context tracking mode */
97         uint8  effective_only; /* 0x00 - effective only */
98
99 } LSA_SEC_QOS;
100
101 typedef struct obj_attr_info
102 {
103         uint32 len;          /* 0x18 - length (in bytes) inc. the length field. */
104         uint32 ptr_root_dir; /* 0 - root directory (pointer) */
105         uint32 ptr_obj_name; /* 0 - object name (pointer) */
106         uint32 attributes;   /* 0 - attributes (undocumented) */
107         uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */
108         uint32 ptr_sec_qos;  /* security quality of service */
109         LSA_SEC_QOS *sec_qos;
110
111 } LSA_OBJ_ATTR;
112
113 /* LSA_Q_OPEN_POL - LSA Query Open Policy */
114 typedef struct lsa_q_open_pol_info
115 {
116         uint32 ptr;         /* undocumented buffer pointer */
117         uint16 system_name; /* 0x5c - system name */
118         LSA_OBJ_ATTR attr ; /* object attributes */
119
120         uint32 des_access; /* desired access attributes */
121
122 } LSA_Q_OPEN_POL;
123
124 /* LSA_R_OPEN_POL - response to LSA Open Policy */
125 typedef struct lsa_r_open_pol_info
126 {
127         POLICY_HND pol; /* policy handle */
128         NTSTATUS status; /* return code */
129
130 } LSA_R_OPEN_POL;
131
132 /* LSA_Q_OPEN_POL2 - LSA Query Open Policy */
133 typedef struct lsa_q_open_pol2_info
134 {
135         uint32       ptr;             /* undocumented buffer pointer */
136         UNISTR2      uni_server_name; /* server name, starting with two '\'s */
137         LSA_OBJ_ATTR attr           ; /* object attributes */
138
139         uint32 des_access; /* desired access attributes */
140
141 } LSA_Q_OPEN_POL2;
142
143 /* LSA_R_OPEN_POL2 - response to LSA Open Policy */
144 typedef struct lsa_r_open_pol2_info
145 {
146         POLICY_HND pol; /* policy handle */
147         NTSTATUS status; /* return code */
148
149 } LSA_R_OPEN_POL2;
150
151
152 #define POLICY_VIEW_LOCAL_INFORMATION    0x00000001
153 #define POLICY_VIEW_AUDIT_INFORMATION    0x00000002
154 #define POLICY_GET_PRIVATE_INFORMATION   0x00000004
155 #define POLICY_TRUST_ADMIN               0x00000008
156 #define POLICY_CREATE_ACCOUNT            0x00000010
157 #define POLICY_CREATE_SECRET             0x00000020
158 #define POLICY_CREATE_PRIVILEGE          0x00000040
159 #define POLICY_SET_DEFAULT_QUOTA_LIMITS  0x00000080
160 #define POLICY_SET_AUDIT_REQUIREMENTS    0x00000100
161 #define POLICY_AUDIT_LOG_ADMIN           0x00000200
162 #define POLICY_SERVER_ADMIN              0x00000400
163 #define POLICY_LOOKUP_NAMES              0x00000800
164
165 #define POLICY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS  |\
166                             POLICY_VIEW_LOCAL_INFORMATION    |\
167                             POLICY_VIEW_AUDIT_INFORMATION    |\
168                             POLICY_GET_PRIVATE_INFORMATION   |\
169                             POLICY_TRUST_ADMIN               |\
170                             POLICY_CREATE_ACCOUNT            |\
171                             POLICY_CREATE_SECRET             |\
172                             POLICY_CREATE_PRIVILEGE          |\
173                             POLICY_SET_DEFAULT_QUOTA_LIMITS  |\
174                             POLICY_SET_AUDIT_REQUIREMENTS    |\
175                             POLICY_AUDIT_LOG_ADMIN           |\
176                             POLICY_SERVER_ADMIN              |\
177                             POLICY_LOOKUP_NAMES )
178
179
180 #define POLICY_READ       ( STANDARD_RIGHTS_READ_ACCESS      |\
181                             POLICY_VIEW_AUDIT_INFORMATION    |\
182                             POLICY_GET_PRIVATE_INFORMATION)
183
184 #define POLICY_WRITE      ( STD_RIGHT_READ_CONTROL_ACCESS     |\
185                             POLICY_TRUST_ADMIN               |\
186                             POLICY_CREATE_ACCOUNT            |\
187                             POLICY_CREATE_SECRET             |\
188                             POLICY_CREATE_PRIVILEGE          |\
189                             POLICY_SET_DEFAULT_QUOTA_LIMITS  |\
190                             POLICY_SET_AUDIT_REQUIREMENTS    |\
191                             POLICY_AUDIT_LOG_ADMIN           |\
192                             POLICY_SERVER_ADMIN)
193
194 #define POLICY_EXECUTE    ( STANDARD_RIGHTS_EXECUTE_ACCESS   |\
195                             POLICY_VIEW_LOCAL_INFORMATION    |\
196                             POLICY_LOOKUP_NAMES )
197
198 /*******************************************************/
199
200 typedef struct {
201         POLICY_HND pol; 
202         uint32 enum_context; 
203         uint32 preferred_len;   /* preferred maximum length */
204 } LSA_Q_ENUM_TRUST_DOM;
205
206 typedef struct {
207         UNISTR4 name;
208         DOM_SID2 *sid;
209 } DOMAIN_INFO;
210
211 typedef struct {
212         uint32 count;
213         DOMAIN_INFO *domains;
214 } DOMAIN_LIST;
215
216 typedef struct {
217         uint32 enum_context;
218         uint32 count;
219         DOMAIN_LIST *domlist;
220         NTSTATUS status; 
221 } LSA_R_ENUM_TRUST_DOM;
222
223 /*******************************************************/
224
225 /* LSA_Q_CLOSE */
226 typedef struct lsa_q_close_info
227 {
228         POLICY_HND pol; /* policy handle */
229
230 } LSA_Q_CLOSE;
231
232 /* LSA_R_CLOSE */
233 typedef struct lsa_r_close_info
234 {
235         POLICY_HND pol; /* policy handle.  should be all zeros. */
236
237         NTSTATUS status; /* return code */
238
239 } LSA_R_CLOSE;
240
241
242 #define MAX_REF_DOMAINS 32
243
244 /* DOM_TRUST_HDR */
245 typedef struct dom_trust_hdr
246 {
247         UNIHDR hdr_dom_name; /* referenced domain unicode string headers */
248         uint32 ptr_dom_sid;
249
250 } DOM_TRUST_HDR;
251         
252 /* DOM_TRUST_INFO */
253 typedef struct dom_trust_info
254 {
255         UNISTR2  uni_dom_name; /* domain name unicode string */
256         DOM_SID2 ref_dom     ; /* referenced domain SID */
257
258 } DOM_TRUST_INFO;
259         
260 /* DOM_R_REF */
261 typedef struct dom_ref_info
262 {
263         uint32 num_ref_doms_1; /* num referenced domains */
264         uint32 ptr_ref_dom; /* pointer to referenced domains */
265         uint32 max_entries; /* 32 - max number of entries */
266         uint32 num_ref_doms_2; /* num referenced domains */
267
268         DOM_TRUST_HDR  hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */
269         DOM_TRUST_INFO ref_dom    [MAX_REF_DOMAINS]; /* referenced domains */
270
271 } DOM_R_REF;
272
273 /* the domain_idx points to a SID associated with the name */
274
275 /* LSA_TRANS_NAME - translated name */
276 typedef struct lsa_trans_name_info
277 {
278         uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
279         UNIHDR hdr_name; 
280         uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
281
282 } LSA_TRANS_NAME;
283
284 /* LSA_TRANS_NAME2 - translated name */
285 typedef struct lsa_trans_name_info2
286 {
287         uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
288         UNIHDR hdr_name; 
289         uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
290         uint32 unknown;
291
292 } LSA_TRANS_NAME2;
293
294 /* This number is based on Win2k and later maximum response allowed */
295 #define MAX_LOOKUP_SIDS 20480   /* 0x5000 */
296
297 /* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */
298 typedef struct lsa_trans_name_enum_info
299 {
300         uint32 num_entries;
301         uint32 ptr_trans_names;
302         uint32 num_entries2;
303         
304         LSA_TRANS_NAME *name; /* translated names  */
305         UNISTR2 *uni_name;
306
307 } LSA_TRANS_NAME_ENUM;
308
309 /* LSA_TRANS_NAME_ENUM2 - LSA Translated Name Enumeration container 2 */
310 typedef struct lsa_trans_name_enum_info2
311 {
312         uint32 num_entries;
313         uint32 ptr_trans_names;
314         uint32 num_entries2;
315         
316         LSA_TRANS_NAME2 *name; /* translated names  */
317         UNISTR2 *uni_name;
318
319 } LSA_TRANS_NAME_ENUM2;
320
321 /* LSA_SID_ENUM - LSA SID enumeration container */
322 typedef struct lsa_sid_enum_info
323 {
324         uint32 num_entries;
325         uint32 ptr_sid_enum;
326         uint32 num_entries2;
327         
328         uint32 *ptr_sid; /* domain SID pointers to be looked up. */
329         DOM_SID2 *sid; /* domain SIDs to be looked up. */
330
331 } LSA_SID_ENUM;
332
333 /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
334 typedef struct lsa_q_lookup_sids
335 {
336         POLICY_HND          pol; /* policy handle */
337         LSA_SID_ENUM        sids;
338         LSA_TRANS_NAME_ENUM names;
339         uint16              level;
340         uint32              mapped_count;
341
342 } LSA_Q_LOOKUP_SIDS;
343
344 /* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
345 typedef struct lsa_r_lookup_sids
346 {
347         uint32              ptr_dom_ref;
348         DOM_R_REF           *dom_ref; /* domain reference info */
349
350         LSA_TRANS_NAME_ENUM names;
351         uint32              mapped_count;
352
353         NTSTATUS            status; /* return code */
354
355 } LSA_R_LOOKUP_SIDS;
356
357 /* LSA_Q_LOOKUP_SIDS2 - LSA Lookup SIDs 2*/
358 typedef struct lsa_q_lookup_sids2
359 {
360         POLICY_HND          pol; /* policy handle */
361         LSA_SID_ENUM        sids;
362         LSA_TRANS_NAME_ENUM2 names;
363         uint16              level;
364         uint32              mapped_count;
365         uint32              unknown1;
366         uint32              unknown2;
367
368 } LSA_Q_LOOKUP_SIDS2;
369
370 /* LSA_R_LOOKUP_SIDS2 - response to LSA Lookup SIDs 2*/
371 typedef struct lsa_r_lookup_sids2
372 {
373         uint32              ptr_dom_ref;
374         DOM_R_REF           *dom_ref; /* domain reference info */
375
376         LSA_TRANS_NAME_ENUM2 names;
377         uint32              mapped_count;
378
379         NTSTATUS            status; /* return code */
380
381 } LSA_R_LOOKUP_SIDS2;
382
383 /* LSA_Q_LOOKUP_SIDS3 - LSA Lookup SIDs 3 */
384 typedef struct lsa_q_lookup_sids3
385 {
386         LSA_SID_ENUM        sids;
387         LSA_TRANS_NAME_ENUM2 names;
388         uint16              level;
389         uint32              mapped_count;
390         uint32              unknown1;
391         uint32              unknown2;
392
393 } LSA_Q_LOOKUP_SIDS3;
394
395 /* LSA_R_LOOKUP_SIDS3 - response to LSA Lookup SIDs 3 */
396 typedef struct lsa_r_lookup_sids3
397 {
398         uint32              ptr_dom_ref;
399         DOM_R_REF           *dom_ref; /* domain reference info */
400
401         LSA_TRANS_NAME_ENUM2 names;
402         uint32              mapped_count;
403
404         NTSTATUS            status; /* return code */
405
406 } LSA_R_LOOKUP_SIDS3;
407
408 /* LSA_Q_LOOKUP_NAMES - LSA Lookup NAMEs */
409 typedef struct lsa_q_lookup_names
410 {
411         POLICY_HND pol; /* policy handle */
412         uint32 num_entries;
413         uint32 num_entries2;
414         UNIHDR  *hdr_name; /* name buffer pointers */
415         UNISTR2 *uni_name; /* names to be looked up */
416
417         uint32 num_trans_entries;
418         uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
419         uint16 lookup_level;
420         uint32 mapped_count;
421
422 } LSA_Q_LOOKUP_NAMES;
423
424 /* LSA_R_LOOKUP_NAMES - response to LSA Lookup NAMEs by name */
425 typedef struct lsa_r_lookup_names
426 {
427         uint32 ptr_dom_ref;
428         DOM_R_REF *dom_ref; /* domain reference info */
429
430         uint32 num_entries;
431         uint32 ptr_entries;
432         uint32 num_entries2;
433         DOM_RID *dom_rid; /* domain RIDs being looked up */
434
435         uint32 mapped_count;
436
437         NTSTATUS status; /* return code */
438 } LSA_R_LOOKUP_NAMES;
439
440 /* LSA_Q_LOOKUP_NAMES2 - LSA Lookup NAMEs 2*/
441 typedef struct lsa_q_lookup_names2
442 {
443         POLICY_HND pol; /* policy handle */
444         uint32 num_entries;
445         uint32 num_entries2;
446         UNIHDR  *hdr_name; /* name buffer pointers */
447         UNISTR2 *uni_name; /* names to be looked up */
448
449         uint32 num_trans_entries;
450         uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
451         uint16 lookup_level;
452         uint32 mapped_count;
453         uint32 unknown1;
454         uint32 unknown2;
455
456 } LSA_Q_LOOKUP_NAMES2;
457
458 /* LSA_R_LOOKUP_NAMES2 - response to LSA Lookup NAMEs by name 2 */
459 typedef struct lsa_r_lookup_names2
460 {
461         uint32 ptr_dom_ref;
462         DOM_R_REF *dom_ref; /* domain reference info */
463
464         uint32 num_entries;
465         uint32 ptr_entries;
466         uint32 num_entries2;
467         DOM_RID2 *dom_rid; /* domain RIDs being looked up */
468
469         uint32 mapped_count;
470
471         NTSTATUS status; /* return code */
472 } LSA_R_LOOKUP_NAMES2;
473
474 /* LSA_Q_LOOKUP_NAMES3 - LSA Lookup NAMEs 3 */
475 typedef struct lsa_q_lookup_names3
476 {
477         POLICY_HND pol; /* policy handle */
478         uint32 num_entries;
479         uint32 num_entries2;
480         UNIHDR  *hdr_name; /* name buffer pointers */
481         UNISTR2 *uni_name; /* names to be looked up */
482
483         uint32 num_trans_entries;
484         uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
485         uint16 lookup_level;
486         uint32 mapped_count;
487         uint32 unknown1;
488         uint32 unknown2;
489
490 } LSA_Q_LOOKUP_NAMES3;
491
492 /* Sid type used in lookupnames3 and lookupnames4. */
493 typedef struct lsa_translatedsid3 {
494         uint8 sid_type;
495         DOM_SID2 *sid2;
496         uint32 sid_idx;
497         uint32 unknown;
498 } LSA_TRANSLATED_SID3;
499
500 /* LSA_R_LOOKUP_NAMES3 - response to LSA Lookup NAMEs by name 3 */
501 typedef struct lsa_r_lookup_names3
502 {
503         uint32 ptr_dom_ref;
504         DOM_R_REF *dom_ref; /* domain reference info */
505
506         uint32 num_entries;
507         uint32 ptr_entries;
508         uint32 num_entries2;
509         LSA_TRANSLATED_SID3 *trans_sids;
510
511         uint32 mapped_count;
512
513         NTSTATUS status; /* return code */
514 } LSA_R_LOOKUP_NAMES3;
515
516 /* LSA_Q_LOOKUP_NAMES4 - LSA Lookup NAMEs 4 */
517 typedef struct lsa_q_lookup_names4
518 {
519         uint32 num_entries;
520         uint32 num_entries2;
521         UNIHDR  *hdr_name; /* name buffer pointers */
522         UNISTR2 *uni_name; /* names to be looked up */
523
524         uint32 num_trans_entries;
525         uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
526         uint16 lookup_level;
527         uint32 mapped_count;
528         uint32 unknown1;
529         uint32 unknown2;
530
531 } LSA_Q_LOOKUP_NAMES4;
532
533 /* LSA_R_LOOKUP_NAMES3 - response to LSA Lookup NAMEs by name 4 */
534 typedef struct lsa_r_lookup_names4
535 {
536         uint32 ptr_dom_ref;
537         DOM_R_REF *dom_ref; /* domain reference info */
538
539         uint32 num_entries;
540         uint32 ptr_entries;
541         uint32 num_entries2;
542         LSA_TRANSLATED_SID3 *trans_sids;
543
544         uint32 mapped_count;
545
546         NTSTATUS status; /* return code */
547 } LSA_R_LOOKUP_NAMES4;
548
549 typedef struct lsa_enum_priv_entry
550 {
551         UNIHDR hdr_name;
552         uint32 luid_low;
553         uint32 luid_high;
554         UNISTR2 name;
555         
556 } LSA_PRIV_ENTRY;
557
558 /* LSA_Q_ENUM_PRIVS - LSA enum privileges */
559 typedef struct lsa_q_enum_privs
560 {
561         POLICY_HND pol; /* policy handle */
562         uint32 enum_context;
563         uint32 pref_max_length;
564 } LSA_Q_ENUM_PRIVS;
565
566 typedef struct lsa_r_enum_privs
567 {
568         uint32 enum_context;
569         uint32 count;
570         uint32 ptr;
571         uint32 count1;
572
573         LSA_PRIV_ENTRY *privs;
574
575         NTSTATUS status;
576 } LSA_R_ENUM_PRIVS;
577
578 /* LSA_Q_ENUM_ACCT_RIGHTS - LSA enum account rights */
579 typedef struct
580 {
581         POLICY_HND pol; /* policy handle */
582         DOM_SID2 sid;
583 } LSA_Q_ENUM_ACCT_RIGHTS;
584
585 /* LSA_R_ENUM_ACCT_RIGHTS - LSA enum account rights */
586 typedef struct
587 {
588         uint32 count;
589         UNISTR4_ARRAY *rights;
590         NTSTATUS status;
591 } LSA_R_ENUM_ACCT_RIGHTS;
592
593
594 /* LSA_Q_ADD_ACCT_RIGHTS - LSA add account rights */
595 typedef struct
596 {
597         POLICY_HND pol; /* policy handle */
598         DOM_SID2 sid;
599         uint32 count;
600         UNISTR4_ARRAY *rights;
601 } LSA_Q_ADD_ACCT_RIGHTS;
602
603 /* LSA_R_ADD_ACCT_RIGHTS - LSA add account rights */
604 typedef struct
605 {
606         NTSTATUS status;
607 } LSA_R_ADD_ACCT_RIGHTS;
608
609
610 /* LSA_Q_REMOVE_ACCT_RIGHTS - LSA remove account rights */
611 typedef struct
612 {
613         POLICY_HND pol; /* policy handle */
614         DOM_SID2 sid;
615         uint32 removeall;
616         uint32 count;
617         UNISTR4_ARRAY *rights;
618 } LSA_Q_REMOVE_ACCT_RIGHTS;
619
620 /* LSA_R_REMOVE_ACCT_RIGHTS - LSA remove account rights */
621 typedef struct
622 {
623         NTSTATUS status;
624 } LSA_R_REMOVE_ACCT_RIGHTS;
625
626
627 /* LSA_Q_PRIV_GET_DISPNAME - LSA get privilege display name */
628 typedef struct lsa_q_priv_get_dispname
629 {
630         POLICY_HND pol; /* policy handle */
631         UNIHDR hdr_name;
632         UNISTR2 name;
633         uint16 lang_id;
634         uint16 lang_id_sys;
635 } LSA_Q_PRIV_GET_DISPNAME;
636
637 typedef struct lsa_r_priv_get_dispname
638 {
639         uint32 ptr_info;
640         UNIHDR hdr_desc;
641         UNISTR2 desc;
642         /* Don't align ! */
643         uint16 lang_id;
644         /* align */
645         NTSTATUS status;
646 } LSA_R_PRIV_GET_DISPNAME;
647
648 /* LSA_Q_ENUM_ACCOUNTS */
649 typedef struct lsa_q_enum_accounts
650 {
651         POLICY_HND pol; /* policy handle */
652         uint32 enum_context;
653         uint32 pref_max_length;
654 } LSA_Q_ENUM_ACCOUNTS;
655
656 /* LSA_R_ENUM_ACCOUNTS */
657 typedef struct lsa_r_enum_accounts
658 {
659         uint32 enum_context;
660         LSA_SID_ENUM sids;
661         NTSTATUS status;
662 } LSA_R_ENUM_ACCOUNTS;
663
664 /* LSA_Q_UNK_GET_CONNUSER - gets username\domain of connected user
665                   called when "Take Ownership" is clicked -SK */
666 typedef struct lsa_q_unk_get_connuser
667 {
668   uint32 ptr_srvname;
669   UNISTR2 uni2_srvname;
670   uint32 unk1; /* 3 unknown uint32's are seen right after uni2_srvname */
671   uint32 unk2; /* unk2 appears to be a ptr, unk1 = unk3 = 0 usually */
672   uint32 unk3; 
673 } LSA_Q_UNK_GET_CONNUSER;
674
675 /* LSA_R_UNK_GET_CONNUSER */
676 typedef struct lsa_r_unk_get_connuser
677 {
678   uint32 ptr_user_name;
679   UNIHDR hdr_user_name;
680   UNISTR2 uni2_user_name;
681   
682   uint32 unk1;
683   
684   uint32 ptr_dom_name;
685   UNIHDR hdr_dom_name;
686   UNISTR2 uni2_dom_name;
687
688   NTSTATUS status;
689 } LSA_R_UNK_GET_CONNUSER;
690
691
692 typedef struct lsa_q_openaccount
693 {
694         POLICY_HND pol; /* policy handle */
695         DOM_SID2 sid;
696         uint32 access; /* desired access */
697 } LSA_Q_OPENACCOUNT;
698
699 typedef struct lsa_r_openaccount
700 {
701         POLICY_HND pol; /* policy handle */
702         NTSTATUS status;
703 } LSA_R_OPENACCOUNT;
704
705 typedef struct lsa_q_enumprivsaccount
706 {
707         POLICY_HND pol; /* policy handle */
708 } LSA_Q_ENUMPRIVSACCOUNT;
709
710 typedef struct lsa_r_enumprivsaccount
711 {
712         uint32 ptr;
713         uint32 count;
714         PRIVILEGE_SET set;
715         NTSTATUS status;
716 } LSA_R_ENUMPRIVSACCOUNT;
717
718 typedef struct lsa_q_getsystemaccount
719 {
720         POLICY_HND pol; /* policy handle */
721 } LSA_Q_GETSYSTEMACCOUNT;
722
723 typedef struct lsa_r_getsystemaccount
724 {
725         uint32 access;
726         NTSTATUS status;
727 } LSA_R_GETSYSTEMACCOUNT;
728
729
730 typedef struct lsa_q_setsystemaccount
731 {
732         POLICY_HND pol; /* policy handle */
733         uint32 access;
734 } LSA_Q_SETSYSTEMACCOUNT;
735
736 typedef struct lsa_r_setsystemaccount
737 {
738         NTSTATUS status;
739 } LSA_R_SETSYSTEMACCOUNT;
740
741 typedef struct {
742         UNIHDR hdr;
743         UNISTR2 unistring;
744 } LSA_STRING;
745
746 typedef struct {
747         POLICY_HND pol; /* policy handle */
748         LSA_STRING privname;
749 } LSA_Q_LOOKUP_PRIV_VALUE;
750
751 typedef struct {
752         LUID luid;
753         NTSTATUS status;
754 } LSA_R_LOOKUP_PRIV_VALUE;
755
756 typedef struct lsa_q_addprivs
757 {
758         POLICY_HND pol; /* policy handle */
759         uint32 count;
760         PRIVILEGE_SET set;
761 } LSA_Q_ADDPRIVS;
762
763 typedef struct lsa_r_addprivs
764 {
765         NTSTATUS status;
766 } LSA_R_ADDPRIVS;
767
768
769 typedef struct lsa_q_removeprivs
770 {
771         POLICY_HND pol; /* policy handle */
772         uint32 allrights;
773         uint32 ptr;
774         uint32 count;
775         PRIVILEGE_SET set;
776 } LSA_Q_REMOVEPRIVS;
777
778 typedef struct lsa_r_removeprivs
779 {
780         NTSTATUS status;
781 } LSA_R_REMOVEPRIVS;
782
783 #endif /* _RPC_LSA_H */