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