r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[Samba/bb.git] / source / include / rpc_lsa.h
blob9f90b53ffabdb1e42ec6f6c7f2a68357d9b3c000
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
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.
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.
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/>.
23 #ifndef _RPC_LSA_H /* _RPC_LSA_H */
24 #define _RPC_LSA_H
26 /* Opcodes available on PIPE_LSARPC */
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
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
85 /* XXXX these are here to get a compile! */
86 #define LSA_LOOKUPRIDS 0xFD
88 #define LSA_AUDIT_NUM_CATEGORIES_NT4 7
89 #define LSA_AUDIT_NUM_CATEGORIES_WIN2K 9
91 #define LSA_AUDIT_NUM_CATEGORIES LSA_AUDIT_NUM_CATEGORIES_NT4
93 #define LSA_AUDIT_POLICY_NONE 0x00
94 #define LSA_AUDIT_POLICY_SUCCESS 0x01
95 #define LSA_AUDIT_POLICY_FAILURE 0x02
96 #define LSA_AUDIT_POLICY_ALL (LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE)
97 #define LSA_AUDIT_POLICY_CLEAR 0x04
99 enum lsa_audit_categories {
100 LSA_AUDIT_CATEGORY_SYSTEM = 0,
101 LSA_AUDIT_CATEGORY_LOGON = 1,
102 LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS,
103 LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS,
104 LSA_AUDIT_CATEGORY_PROCCESS_TRACKING,
105 LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES,
106 LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT,
107 LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS, /* only in win2k/2k3 */
108 LSA_AUDIT_CATEGORY_ACCOUNT_LOGON /* only in win2k/2k3 */
111 /* level 1 is auditing settings */
112 typedef struct dom_query_1
114 uint32 percent_full;
115 uint32 log_size;
116 NTTIME retention_time;
117 uint8 shutdown_in_progress;
118 NTTIME time_to_shutdown;
119 uint32 next_audit_record;
120 uint32 unknown;
121 } DOM_QUERY_1;
124 /* level 2 is auditing settings */
125 typedef struct dom_query_2
127 uint32 auditing_enabled;
128 uint32 count1; /* usualy 7, at least on nt4sp4 */
129 uint32 count2; /* the same */
130 uint32 ptr;
131 uint32 *auditsettings;
132 } DOM_QUERY_2;
134 /* DOM_QUERY - info class 3 and 5 LSA Query response */
135 typedef struct dom_query_info_3
137 uint16 uni_dom_max_len; /* domain name string length * 2 */
138 uint16 uni_dom_str_len; /* domain name string length * 2 */
139 uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */
140 uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */
141 UNISTR2 uni_domain_name; /* domain name (unicode string) */
142 DOM_SID2 dom_sid; /* domain SID */
144 } DOM_QUERY_3;
146 /* level 5 is same as level 3. */
147 typedef DOM_QUERY_3 DOM_QUERY_5;
149 /* level 6 is server role information */
150 typedef struct dom_query_6
152 uint16 server_role; /* 2=backup, 3=primary */
153 } DOM_QUERY_6;
155 /* level 10 is audit full set info */
156 typedef struct dom_query_10
158 uint8 shutdown_on_full;
159 } DOM_QUERY_10;
161 /* level 11 is audit full query info */
162 typedef struct dom_query_11
164 uint16 unknown;
165 uint8 shutdown_on_full;
166 uint8 log_is_full;
167 } DOM_QUERY_11;
169 /* level 12 is DNS domain info */
170 typedef struct lsa_dns_dom_info
172 UNIHDR hdr_nb_dom_name; /* netbios domain name */
173 UNIHDR hdr_dns_dom_name;
174 UNIHDR hdr_forest_name;
176 struct GUID dom_guid; /* domain GUID */
178 UNISTR2 uni_nb_dom_name;
179 UNISTR2 uni_dns_dom_name;
180 UNISTR2 uni_forest_name;
182 uint32 ptr_dom_sid;
183 DOM_SID2 dom_sid; /* domain SID */
184 } DOM_QUERY_12;
186 typedef struct seq_qos_info
188 uint32 len; /* 12 */
189 uint16 sec_imp_level; /* 0x02 - impersonation level */
190 uint8 sec_ctxt_mode; /* 0x01 - context tracking mode */
191 uint8 effective_only; /* 0x00 - effective only */
193 } LSA_SEC_QOS;
195 typedef struct obj_attr_info
197 uint32 len; /* 0x18 - length (in bytes) inc. the length field. */
198 uint32 ptr_root_dir; /* 0 - root directory (pointer) */
199 uint32 ptr_obj_name; /* 0 - object name (pointer) */
200 uint32 attributes; /* 0 - attributes (undocumented) */
201 uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */
202 uint32 ptr_sec_qos; /* security quality of service */
203 LSA_SEC_QOS *sec_qos;
205 } LSA_OBJ_ATTR;
207 /* LSA_Q_OPEN_POL - LSA Query Open Policy */
208 typedef struct lsa_q_open_pol_info
210 uint32 ptr; /* undocumented buffer pointer */
211 uint16 system_name; /* 0x5c - system name */
212 LSA_OBJ_ATTR attr ; /* object attributes */
214 uint32 des_access; /* desired access attributes */
216 } LSA_Q_OPEN_POL;
218 /* LSA_R_OPEN_POL - response to LSA Open Policy */
219 typedef struct lsa_r_open_pol_info
221 POLICY_HND pol; /* policy handle */
222 NTSTATUS status; /* return code */
224 } LSA_R_OPEN_POL;
226 /* LSA_Q_OPEN_POL2 - LSA Query Open Policy */
227 typedef struct lsa_q_open_pol2_info
229 uint32 ptr; /* undocumented buffer pointer */
230 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
231 LSA_OBJ_ATTR attr ; /* object attributes */
233 uint32 des_access; /* desired access attributes */
235 } LSA_Q_OPEN_POL2;
237 /* LSA_R_OPEN_POL2 - response to LSA Open Policy */
238 typedef struct lsa_r_open_pol2_info
240 POLICY_HND pol; /* policy handle */
241 NTSTATUS status; /* return code */
243 } LSA_R_OPEN_POL2;
246 #define POLICY_VIEW_LOCAL_INFORMATION 0x00000001
247 #define POLICY_VIEW_AUDIT_INFORMATION 0x00000002
248 #define POLICY_GET_PRIVATE_INFORMATION 0x00000004
249 #define POLICY_TRUST_ADMIN 0x00000008
250 #define POLICY_CREATE_ACCOUNT 0x00000010
251 #define POLICY_CREATE_SECRET 0x00000020
252 #define POLICY_CREATE_PRIVILEGE 0x00000040
253 #define POLICY_SET_DEFAULT_QUOTA_LIMITS 0x00000080
254 #define POLICY_SET_AUDIT_REQUIREMENTS 0x00000100
255 #define POLICY_AUDIT_LOG_ADMIN 0x00000200
256 #define POLICY_SERVER_ADMIN 0x00000400
257 #define POLICY_LOOKUP_NAMES 0x00000800
259 #define POLICY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS |\
260 POLICY_VIEW_LOCAL_INFORMATION |\
261 POLICY_VIEW_AUDIT_INFORMATION |\
262 POLICY_GET_PRIVATE_INFORMATION |\
263 POLICY_TRUST_ADMIN |\
264 POLICY_CREATE_ACCOUNT |\
265 POLICY_CREATE_SECRET |\
266 POLICY_CREATE_PRIVILEGE |\
267 POLICY_SET_DEFAULT_QUOTA_LIMITS |\
268 POLICY_SET_AUDIT_REQUIREMENTS |\
269 POLICY_AUDIT_LOG_ADMIN |\
270 POLICY_SERVER_ADMIN |\
271 POLICY_LOOKUP_NAMES )
274 #define POLICY_READ ( STANDARD_RIGHTS_READ_ACCESS |\
275 POLICY_VIEW_AUDIT_INFORMATION |\
276 POLICY_GET_PRIVATE_INFORMATION)
278 #define POLICY_WRITE ( STD_RIGHT_READ_CONTROL_ACCESS |\
279 POLICY_TRUST_ADMIN |\
280 POLICY_CREATE_ACCOUNT |\
281 POLICY_CREATE_SECRET |\
282 POLICY_CREATE_PRIVILEGE |\
283 POLICY_SET_DEFAULT_QUOTA_LIMITS |\
284 POLICY_SET_AUDIT_REQUIREMENTS |\
285 POLICY_AUDIT_LOG_ADMIN |\
286 POLICY_SERVER_ADMIN)
288 #define POLICY_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS |\
289 POLICY_VIEW_LOCAL_INFORMATION |\
290 POLICY_LOOKUP_NAMES )
292 /* LSA_Q_QUERY_SEC_OBJ - LSA query security */
293 typedef struct lsa_query_sec_obj_info
295 POLICY_HND pol; /* policy handle */
296 uint32 sec_info;
298 } LSA_Q_QUERY_SEC_OBJ;
300 /* LSA_R_QUERY_SEC_OBJ - probably an open */
301 typedef struct r_lsa_query_sec_obj_info
303 uint32 ptr;
304 SEC_DESC_BUF *buf;
306 NTSTATUS status; /* return status */
308 } LSA_R_QUERY_SEC_OBJ;
310 /* LSA_Q_QUERY_INFO - LSA query info policy */
311 typedef struct lsa_query_info
313 POLICY_HND pol; /* policy handle */
314 uint16 info_class; /* info class */
316 } LSA_Q_QUERY_INFO;
318 /* LSA_INFO_CTR */
319 typedef struct lsa_info_ctr
321 uint16 info_class;
322 union {
323 DOM_QUERY_1 id1;
324 DOM_QUERY_2 id2;
325 DOM_QUERY_3 id3;
326 DOM_QUERY_5 id5;
327 DOM_QUERY_6 id6;
328 DOM_QUERY_10 id10;
329 DOM_QUERY_11 id11;
330 DOM_QUERY_12 id12;
331 } info;
333 } LSA_INFO_CTR;
335 typedef LSA_INFO_CTR LSA_INFO_CTR2;
337 /* LSA_Q_SET_INFO - LSA set info policy */
338 typedef struct lsa_set_info
340 POLICY_HND pol; /* policy handle */
341 uint16 info_class; /* info class */
342 LSA_INFO_CTR ctr;
344 } LSA_Q_SET_INFO;
346 /* LSA_R_SET_INFO - response to LSA set info policy */
347 typedef struct lsa_r_set_info
349 NTSTATUS status; /* return code */
351 } LSA_R_SET_INFO;
353 /* LSA_R_QUERY_INFO - response to LSA query info policy */
354 typedef struct lsa_r_query_info
356 uint32 dom_ptr; /* undocumented buffer pointer */
357 LSA_INFO_CTR ctr;
358 NTSTATUS status; /* return code */
360 } LSA_R_QUERY_INFO;
362 typedef LSA_Q_QUERY_INFO LSA_Q_QUERY_INFO2;
363 typedef LSA_R_QUERY_INFO LSA_R_QUERY_INFO2;
365 /*******************************************************/
367 typedef struct {
368 POLICY_HND pol;
369 uint32 enum_context;
370 uint32 preferred_len; /* preferred maximum length */
371 } LSA_Q_ENUM_TRUST_DOM;
373 typedef struct {
374 UNISTR4 name;
375 DOM_SID2 *sid;
376 } DOMAIN_INFO;
378 typedef struct {
379 uint32 count;
380 DOMAIN_INFO *domains;
381 } DOMAIN_LIST;
383 typedef struct {
384 uint32 enum_context;
385 uint32 count;
386 DOMAIN_LIST *domlist;
387 NTSTATUS status;
388 } LSA_R_ENUM_TRUST_DOM;
390 /*******************************************************/
392 /* LSA_Q_CLOSE */
393 typedef struct lsa_q_close_info
395 POLICY_HND pol; /* policy handle */
397 } LSA_Q_CLOSE;
399 /* LSA_R_CLOSE */
400 typedef struct lsa_r_close_info
402 POLICY_HND pol; /* policy handle. should be all zeros. */
404 NTSTATUS status; /* return code */
406 } LSA_R_CLOSE;
409 #define MAX_REF_DOMAINS 32
411 /* DOM_TRUST_HDR */
412 typedef struct dom_trust_hdr
414 UNIHDR hdr_dom_name; /* referenced domain unicode string headers */
415 uint32 ptr_dom_sid;
417 } DOM_TRUST_HDR;
419 /* DOM_TRUST_INFO */
420 typedef struct dom_trust_info
422 UNISTR2 uni_dom_name; /* domain name unicode string */
423 DOM_SID2 ref_dom ; /* referenced domain SID */
425 } DOM_TRUST_INFO;
427 /* DOM_R_REF */
428 typedef struct dom_ref_info
430 uint32 num_ref_doms_1; /* num referenced domains */
431 uint32 ptr_ref_dom; /* pointer to referenced domains */
432 uint32 max_entries; /* 32 - max number of entries */
433 uint32 num_ref_doms_2; /* num referenced domains */
435 DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */
436 DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */
438 } DOM_R_REF;
440 /* the domain_idx points to a SID associated with the name */
442 /* LSA_TRANS_NAME - translated name */
443 typedef struct lsa_trans_name_info
445 uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
446 UNIHDR hdr_name;
447 uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
449 } LSA_TRANS_NAME;
451 /* LSA_TRANS_NAME2 - translated name */
452 typedef struct lsa_trans_name_info2
454 uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
455 UNIHDR hdr_name;
456 uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
457 uint32 unknown;
459 } LSA_TRANS_NAME2;
461 /* This number is based on Win2k and later maximum response allowed */
462 #define MAX_LOOKUP_SIDS 20480 /* 0x5000 */
464 /* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */
465 typedef struct lsa_trans_name_enum_info
467 uint32 num_entries;
468 uint32 ptr_trans_names;
469 uint32 num_entries2;
471 LSA_TRANS_NAME *name; /* translated names */
472 UNISTR2 *uni_name;
474 } LSA_TRANS_NAME_ENUM;
476 /* LSA_TRANS_NAME_ENUM2 - LSA Translated Name Enumeration container 2 */
477 typedef struct lsa_trans_name_enum_info2
479 uint32 num_entries;
480 uint32 ptr_trans_names;
481 uint32 num_entries2;
483 LSA_TRANS_NAME2 *name; /* translated names */
484 UNISTR2 *uni_name;
486 } LSA_TRANS_NAME_ENUM2;
488 /* LSA_SID_ENUM - LSA SID enumeration container */
489 typedef struct lsa_sid_enum_info
491 uint32 num_entries;
492 uint32 ptr_sid_enum;
493 uint32 num_entries2;
495 uint32 *ptr_sid; /* domain SID pointers to be looked up. */
496 DOM_SID2 *sid; /* domain SIDs to be looked up. */
498 } LSA_SID_ENUM;
500 /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
501 typedef struct lsa_q_lookup_sids
503 POLICY_HND pol; /* policy handle */
504 LSA_SID_ENUM sids;
505 LSA_TRANS_NAME_ENUM names;
506 uint16 level;
507 uint32 mapped_count;
509 } LSA_Q_LOOKUP_SIDS;
511 /* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
512 typedef struct lsa_r_lookup_sids
514 uint32 ptr_dom_ref;
515 DOM_R_REF *dom_ref; /* domain reference info */
517 LSA_TRANS_NAME_ENUM names;
518 uint32 mapped_count;
520 NTSTATUS status; /* return code */
522 } LSA_R_LOOKUP_SIDS;
524 /* LSA_Q_LOOKUP_SIDS2 - LSA Lookup SIDs 2*/
525 typedef struct lsa_q_lookup_sids2
527 POLICY_HND pol; /* policy handle */
528 LSA_SID_ENUM sids;
529 LSA_TRANS_NAME_ENUM2 names;
530 uint16 level;
531 uint32 mapped_count;
532 uint32 unknown1;
533 uint32 unknown2;
535 } LSA_Q_LOOKUP_SIDS2;
537 /* LSA_R_LOOKUP_SIDS2 - response to LSA Lookup SIDs 2*/
538 typedef struct lsa_r_lookup_sids2
540 uint32 ptr_dom_ref;
541 DOM_R_REF *dom_ref; /* domain reference info */
543 LSA_TRANS_NAME_ENUM2 names;
544 uint32 mapped_count;
546 NTSTATUS status; /* return code */
548 } LSA_R_LOOKUP_SIDS2;
550 /* LSA_Q_LOOKUP_SIDS3 - LSA Lookup SIDs 3 */
551 typedef struct lsa_q_lookup_sids3
553 LSA_SID_ENUM sids;
554 LSA_TRANS_NAME_ENUM2 names;
555 uint16 level;
556 uint32 mapped_count;
557 uint32 unknown1;
558 uint32 unknown2;
560 } LSA_Q_LOOKUP_SIDS3;
562 /* LSA_R_LOOKUP_SIDS3 - response to LSA Lookup SIDs 3 */
563 typedef struct lsa_r_lookup_sids3
565 uint32 ptr_dom_ref;
566 DOM_R_REF *dom_ref; /* domain reference info */
568 LSA_TRANS_NAME_ENUM2 names;
569 uint32 mapped_count;
571 NTSTATUS status; /* return code */
573 } LSA_R_LOOKUP_SIDS3;
575 /* LSA_Q_LOOKUP_NAMES - LSA Lookup NAMEs */
576 typedef struct lsa_q_lookup_names
578 POLICY_HND pol; /* policy handle */
579 uint32 num_entries;
580 uint32 num_entries2;
581 UNIHDR *hdr_name; /* name buffer pointers */
582 UNISTR2 *uni_name; /* names to be looked up */
584 uint32 num_trans_entries;
585 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
586 uint16 lookup_level;
587 uint32 mapped_count;
589 } LSA_Q_LOOKUP_NAMES;
591 /* LSA_R_LOOKUP_NAMES - response to LSA Lookup NAMEs by name */
592 typedef struct lsa_r_lookup_names
594 uint32 ptr_dom_ref;
595 DOM_R_REF *dom_ref; /* domain reference info */
597 uint32 num_entries;
598 uint32 ptr_entries;
599 uint32 num_entries2;
600 DOM_RID *dom_rid; /* domain RIDs being looked up */
602 uint32 mapped_count;
604 NTSTATUS status; /* return code */
605 } LSA_R_LOOKUP_NAMES;
607 /* LSA_Q_LOOKUP_NAMES2 - LSA Lookup NAMEs 2*/
608 typedef struct lsa_q_lookup_names2
610 POLICY_HND pol; /* policy handle */
611 uint32 num_entries;
612 uint32 num_entries2;
613 UNIHDR *hdr_name; /* name buffer pointers */
614 UNISTR2 *uni_name; /* names to be looked up */
616 uint32 num_trans_entries;
617 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
618 uint16 lookup_level;
619 uint32 mapped_count;
620 uint32 unknown1;
621 uint32 unknown2;
623 } LSA_Q_LOOKUP_NAMES2;
625 /* LSA_R_LOOKUP_NAMES2 - response to LSA Lookup NAMEs by name 2 */
626 typedef struct lsa_r_lookup_names2
628 uint32 ptr_dom_ref;
629 DOM_R_REF *dom_ref; /* domain reference info */
631 uint32 num_entries;
632 uint32 ptr_entries;
633 uint32 num_entries2;
634 DOM_RID2 *dom_rid; /* domain RIDs being looked up */
636 uint32 mapped_count;
638 NTSTATUS status; /* return code */
639 } LSA_R_LOOKUP_NAMES2;
641 /* LSA_Q_LOOKUP_NAMES3 - LSA Lookup NAMEs 3 */
642 typedef struct lsa_q_lookup_names3
644 POLICY_HND pol; /* policy handle */
645 uint32 num_entries;
646 uint32 num_entries2;
647 UNIHDR *hdr_name; /* name buffer pointers */
648 UNISTR2 *uni_name; /* names to be looked up */
650 uint32 num_trans_entries;
651 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
652 uint16 lookup_level;
653 uint32 mapped_count;
654 uint32 unknown1;
655 uint32 unknown2;
657 } LSA_Q_LOOKUP_NAMES3;
659 /* Sid type used in lookupnames3 and lookupnames4. */
660 typedef struct lsa_translatedsid3 {
661 uint8 sid_type;
662 DOM_SID2 *sid2;
663 uint32 sid_idx;
664 uint32 unknown;
665 } LSA_TRANSLATED_SID3;
667 /* LSA_R_LOOKUP_NAMES3 - response to LSA Lookup NAMEs by name 3 */
668 typedef struct lsa_r_lookup_names3
670 uint32 ptr_dom_ref;
671 DOM_R_REF *dom_ref; /* domain reference info */
673 uint32 num_entries;
674 uint32 ptr_entries;
675 uint32 num_entries2;
676 LSA_TRANSLATED_SID3 *trans_sids;
678 uint32 mapped_count;
680 NTSTATUS status; /* return code */
681 } LSA_R_LOOKUP_NAMES3;
683 /* LSA_Q_LOOKUP_NAMES4 - LSA Lookup NAMEs 4 */
684 typedef struct lsa_q_lookup_names4
686 uint32 num_entries;
687 uint32 num_entries2;
688 UNIHDR *hdr_name; /* name buffer pointers */
689 UNISTR2 *uni_name; /* names to be looked up */
691 uint32 num_trans_entries;
692 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
693 uint16 lookup_level;
694 uint32 mapped_count;
695 uint32 unknown1;
696 uint32 unknown2;
698 } LSA_Q_LOOKUP_NAMES4;
700 /* LSA_R_LOOKUP_NAMES3 - response to LSA Lookup NAMEs by name 4 */
701 typedef struct lsa_r_lookup_names4
703 uint32 ptr_dom_ref;
704 DOM_R_REF *dom_ref; /* domain reference info */
706 uint32 num_entries;
707 uint32 ptr_entries;
708 uint32 num_entries2;
709 LSA_TRANSLATED_SID3 *trans_sids;
711 uint32 mapped_count;
713 NTSTATUS status; /* return code */
714 } LSA_R_LOOKUP_NAMES4;
716 typedef struct lsa_enum_priv_entry
718 UNIHDR hdr_name;
719 uint32 luid_low;
720 uint32 luid_high;
721 UNISTR2 name;
723 } LSA_PRIV_ENTRY;
725 /* LSA_Q_ENUM_PRIVS - LSA enum privileges */
726 typedef struct lsa_q_enum_privs
728 POLICY_HND pol; /* policy handle */
729 uint32 enum_context;
730 uint32 pref_max_length;
731 } LSA_Q_ENUM_PRIVS;
733 typedef struct lsa_r_enum_privs
735 uint32 enum_context;
736 uint32 count;
737 uint32 ptr;
738 uint32 count1;
740 LSA_PRIV_ENTRY *privs;
742 NTSTATUS status;
743 } LSA_R_ENUM_PRIVS;
745 /* LSA_Q_ENUM_ACCT_RIGHTS - LSA enum account rights */
746 typedef struct
748 POLICY_HND pol; /* policy handle */
749 DOM_SID2 sid;
750 } LSA_Q_ENUM_ACCT_RIGHTS;
752 /* LSA_R_ENUM_ACCT_RIGHTS - LSA enum account rights */
753 typedef struct
755 uint32 count;
756 UNISTR4_ARRAY *rights;
757 NTSTATUS status;
758 } LSA_R_ENUM_ACCT_RIGHTS;
761 /* LSA_Q_ADD_ACCT_RIGHTS - LSA add account rights */
762 typedef struct
764 POLICY_HND pol; /* policy handle */
765 DOM_SID2 sid;
766 uint32 count;
767 UNISTR4_ARRAY *rights;
768 } LSA_Q_ADD_ACCT_RIGHTS;
770 /* LSA_R_ADD_ACCT_RIGHTS - LSA add account rights */
771 typedef struct
773 NTSTATUS status;
774 } LSA_R_ADD_ACCT_RIGHTS;
777 /* LSA_Q_REMOVE_ACCT_RIGHTS - LSA remove account rights */
778 typedef struct
780 POLICY_HND pol; /* policy handle */
781 DOM_SID2 sid;
782 uint32 removeall;
783 uint32 count;
784 UNISTR4_ARRAY *rights;
785 } LSA_Q_REMOVE_ACCT_RIGHTS;
787 /* LSA_R_REMOVE_ACCT_RIGHTS - LSA remove account rights */
788 typedef struct
790 NTSTATUS status;
791 } LSA_R_REMOVE_ACCT_RIGHTS;
794 /* LSA_Q_PRIV_GET_DISPNAME - LSA get privilege display name */
795 typedef struct lsa_q_priv_get_dispname
797 POLICY_HND pol; /* policy handle */
798 UNIHDR hdr_name;
799 UNISTR2 name;
800 uint16 lang_id;
801 uint16 lang_id_sys;
802 } LSA_Q_PRIV_GET_DISPNAME;
804 typedef struct lsa_r_priv_get_dispname
806 uint32 ptr_info;
807 UNIHDR hdr_desc;
808 UNISTR2 desc;
809 /* Don't align ! */
810 uint16 lang_id;
811 /* align */
812 NTSTATUS status;
813 } LSA_R_PRIV_GET_DISPNAME;
815 /* LSA_Q_ENUM_ACCOUNTS */
816 typedef struct lsa_q_enum_accounts
818 POLICY_HND pol; /* policy handle */
819 uint32 enum_context;
820 uint32 pref_max_length;
821 } LSA_Q_ENUM_ACCOUNTS;
823 /* LSA_R_ENUM_ACCOUNTS */
824 typedef struct lsa_r_enum_accounts
826 uint32 enum_context;
827 LSA_SID_ENUM sids;
828 NTSTATUS status;
829 } LSA_R_ENUM_ACCOUNTS;
831 /* LSA_Q_UNK_GET_CONNUSER - gets username\domain of connected user
832 called when "Take Ownership" is clicked -SK */
833 typedef struct lsa_q_unk_get_connuser
835 uint32 ptr_srvname;
836 UNISTR2 uni2_srvname;
837 uint32 unk1; /* 3 unknown uint32's are seen right after uni2_srvname */
838 uint32 unk2; /* unk2 appears to be a ptr, unk1 = unk3 = 0 usually */
839 uint32 unk3;
840 } LSA_Q_UNK_GET_CONNUSER;
842 /* LSA_R_UNK_GET_CONNUSER */
843 typedef struct lsa_r_unk_get_connuser
845 uint32 ptr_user_name;
846 UNIHDR hdr_user_name;
847 UNISTR2 uni2_user_name;
849 uint32 unk1;
851 uint32 ptr_dom_name;
852 UNIHDR hdr_dom_name;
853 UNISTR2 uni2_dom_name;
855 NTSTATUS status;
856 } LSA_R_UNK_GET_CONNUSER;
859 typedef struct lsa_q_createaccount
861 POLICY_HND pol; /* policy handle */
862 DOM_SID2 sid;
863 uint32 access; /* access */
864 } LSA_Q_CREATEACCOUNT;
866 typedef struct lsa_r_createaccount
868 POLICY_HND pol; /* policy handle */
869 NTSTATUS status;
870 } LSA_R_CREATEACCOUNT;
873 typedef struct lsa_q_openaccount
875 POLICY_HND pol; /* policy handle */
876 DOM_SID2 sid;
877 uint32 access; /* desired access */
878 } LSA_Q_OPENACCOUNT;
880 typedef struct lsa_r_openaccount
882 POLICY_HND pol; /* policy handle */
883 NTSTATUS status;
884 } LSA_R_OPENACCOUNT;
886 typedef struct lsa_q_enumprivsaccount
888 POLICY_HND pol; /* policy handle */
889 } LSA_Q_ENUMPRIVSACCOUNT;
891 typedef struct lsa_r_enumprivsaccount
893 uint32 ptr;
894 uint32 count;
895 PRIVILEGE_SET set;
896 NTSTATUS status;
897 } LSA_R_ENUMPRIVSACCOUNT;
899 typedef struct lsa_q_getsystemaccount
901 POLICY_HND pol; /* policy handle */
902 } LSA_Q_GETSYSTEMACCOUNT;
904 typedef struct lsa_r_getsystemaccount
906 uint32 access;
907 NTSTATUS status;
908 } LSA_R_GETSYSTEMACCOUNT;
911 typedef struct lsa_q_setsystemaccount
913 POLICY_HND pol; /* policy handle */
914 uint32 access;
915 } LSA_Q_SETSYSTEMACCOUNT;
917 typedef struct lsa_r_setsystemaccount
919 NTSTATUS status;
920 } LSA_R_SETSYSTEMACCOUNT;
922 typedef struct {
923 UNIHDR hdr;
924 UNISTR2 unistring;
925 } LSA_STRING;
927 typedef struct {
928 POLICY_HND pol; /* policy handle */
929 LSA_STRING privname;
930 } LSA_Q_LOOKUP_PRIV_VALUE;
932 typedef struct {
933 LUID luid;
934 NTSTATUS status;
935 } LSA_R_LOOKUP_PRIV_VALUE;
937 typedef struct lsa_q_addprivs
939 POLICY_HND pol; /* policy handle */
940 uint32 count;
941 PRIVILEGE_SET set;
942 } LSA_Q_ADDPRIVS;
944 typedef struct lsa_r_addprivs
946 NTSTATUS status;
947 } LSA_R_ADDPRIVS;
950 typedef struct lsa_q_removeprivs
952 POLICY_HND pol; /* policy handle */
953 uint32 allrights;
954 uint32 ptr;
955 uint32 count;
956 PRIVILEGE_SET set;
957 } LSA_Q_REMOVEPRIVS;
959 typedef struct lsa_r_removeprivs
961 NTSTATUS status;
962 } LSA_R_REMOVEPRIVS;
964 /*******************************************************/
965 #if 0 /* jerry, I think this not correct - gd */
966 typedef struct {
967 POLICY_HND handle;
968 uint32 count; /* ??? this is what ethereal calls it */
969 DOM_SID sid;
970 } LSA_Q_OPEN_TRUSTED_DOMAIN;
971 #endif
973 /* LSA_Q_OPEN_TRUSTED_DOMAIN - LSA Query Open Trusted Domain */
974 typedef struct lsa_q_open_trusted_domain
976 POLICY_HND pol; /* policy handle */
977 DOM_SID2 sid; /* domain sid */
978 uint32 access_mask; /* access mask */
980 } LSA_Q_OPEN_TRUSTED_DOMAIN;
982 /* LSA_R_OPEN_TRUSTED_DOMAIN - response to LSA Query Open Trusted Domain */
983 typedef struct {
984 POLICY_HND handle; /* trustdom policy handle */
985 NTSTATUS status; /* return code */
986 } LSA_R_OPEN_TRUSTED_DOMAIN;
989 /*******************************************************/
991 /* LSA_Q_OPEN_TRUSTED_DOMAIN_BY_NAME - LSA Query Open Trusted Domain by Name*/
992 typedef struct lsa_q_open_trusted_domain_by_name
994 POLICY_HND pol; /* policy handle */
995 LSA_STRING name; /* domain name */
996 uint32 access_mask; /* access mask */
998 } LSA_Q_OPEN_TRUSTED_DOMAIN_BY_NAME;
1000 /* LSA_R_OPEN_TRUSTED_DOMAIN_BY_NAME - response to LSA Query Open Trusted Domain by Name */
1001 typedef struct {
1002 POLICY_HND handle; /* trustdom policy handle */
1003 NTSTATUS status; /* return code */
1004 } LSA_R_OPEN_TRUSTED_DOMAIN_BY_NAME;
1007 /*******************************************************/
1010 typedef struct {
1011 POLICY_HND handle;
1012 UNISTR4 secretname;
1013 uint32 access;
1014 } LSA_Q_OPEN_SECRET;
1016 typedef struct {
1017 POLICY_HND handle;
1018 NTSTATUS status;
1019 } LSA_R_OPEN_SECRET;
1022 /*******************************************************/
1024 typedef struct {
1025 POLICY_HND handle;
1026 } LSA_Q_DELETE_OBJECT;
1028 typedef struct {
1029 NTSTATUS status;
1030 } LSA_R_DELETE_OBJECT;
1033 /*******************************************************/
1035 typedef struct {
1036 POLICY_HND handle;
1037 UNISTR4 secretname;
1038 uint32 access;
1039 } LSA_Q_CREATE_SECRET;
1041 typedef struct {
1042 POLICY_HND handle;
1043 NTSTATUS status;
1044 } LSA_R_CREATE_SECRET;
1047 /*******************************************************/
1049 typedef struct {
1050 POLICY_HND handle;
1051 UNISTR4 secretname;
1052 uint32 access;
1053 } LSA_Q_CREATE_TRUSTED_DOMAIN;
1055 typedef struct {
1056 POLICY_HND handle;
1057 NTSTATUS status;
1058 } LSA_R_CREATE_TRUSTED_DOMAIN;
1061 /*******************************************************/
1063 typedef struct {
1064 uint32 size; /* size is written on the wire twice so I
1065 can only assume that one is supposed to
1066 be a max length and one is a size */
1067 UNISTR2 *data; /* not really a UNICODE string but the parsing
1068 is the same */
1069 } LSA_DATA_BLOB;
1071 typedef struct {
1072 POLICY_HND handle;
1073 LSA_DATA_BLOB *old_value;
1074 LSA_DATA_BLOB *new_value;
1075 } LSA_Q_SET_SECRET;
1077 typedef struct {
1078 NTSTATUS status;
1079 } LSA_R_SET_SECRET;
1081 /* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO - LSA query trusted domain info */
1082 typedef struct lsa_query_trusted_domain_info
1084 POLICY_HND pol; /* policy handle */
1085 uint16 info_class; /* info class */
1087 } LSA_Q_QUERY_TRUSTED_DOMAIN_INFO;
1089 /* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_SID - LSA query trusted domain info */
1090 typedef struct lsa_query_trusted_domain_info_by_sid
1092 POLICY_HND pol; /* policy handle */
1093 DOM_SID2 dom_sid; /* domain sid */
1094 uint16 info_class; /* info class */
1096 } LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_SID;
1098 /* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_NAME - LSA query trusted domain info */
1099 typedef struct lsa_query_trusted_domain_info_by_name
1101 POLICY_HND pol; /* policy handle */
1102 LSA_STRING domain_name; /* domain name */
1103 uint16 info_class; /* info class */
1105 } LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_NAME;
1107 typedef struct trusted_domain_info_name {
1108 LSA_STRING netbios_name;
1109 } TRUSTED_DOMAIN_INFO_NAME;
1111 typedef struct trusted_domain_info_posix_offset {
1112 uint32 posix_offset;
1113 } TRUSTED_DOMAIN_INFO_POSIX_OFFSET;
1115 typedef struct lsa_data_buf {
1116 uint32 size;
1117 uint32 offset;
1118 uint32 length;
1119 uint8 *data;
1120 } LSA_DATA_BUF;
1122 typedef struct lsa_data_buf_hdr {
1123 uint32 length;
1124 uint32 size;
1125 uint32 data_ptr;
1126 } LSA_DATA_BUF_HDR;
1129 typedef struct lsa_data_buf2 {
1130 uint32 size;
1131 uint8 *data;
1132 } LSA_DATA_BUF2;
1134 typedef struct trusted_domain_info_password {
1135 uint32 ptr_password;
1136 uint32 ptr_old_password;
1137 LSA_DATA_BUF_HDR password_hdr;
1138 LSA_DATA_BUF_HDR old_password_hdr;
1139 LSA_DATA_BUF password;
1140 LSA_DATA_BUF old_password;
1141 } TRUSTED_DOMAIN_INFO_PASSWORD;
1143 typedef struct trusted_domain_info_basic {
1144 LSA_STRING netbios_name;
1145 DOM_SID2 sid;
1146 } TRUSTED_DOMAIN_INFO_BASIC;
1148 typedef struct trusted_domain_info_ex {
1149 LSA_STRING domain_name;
1150 LSA_STRING netbios_name;
1151 DOM_SID2 sid;
1152 uint32 trust_direction;
1153 uint32 trust_type;
1154 uint32 trust_attributes;
1155 } TRUSTED_DOMAIN_INFO_EX;
1157 typedef struct trust_domain_info_buffer {
1158 NTTIME last_update_time;
1159 uint32 secret_type;
1160 LSA_DATA_BUF2 data;
1161 } LSA_TRUSTED_DOMAIN_INFO_BUFFER;
1163 typedef struct trusted_domain_info_auth_info {
1164 uint32 incoming_count;
1165 LSA_TRUSTED_DOMAIN_INFO_BUFFER incoming_current_auth_info;
1166 LSA_TRUSTED_DOMAIN_INFO_BUFFER incoming_previous_auth_info;
1167 uint32 outgoing_count;
1168 LSA_TRUSTED_DOMAIN_INFO_BUFFER outgoing_current_auth_info;
1169 LSA_TRUSTED_DOMAIN_INFO_BUFFER outgoing_previous_auth_info;
1170 } TRUSTED_DOMAIN_INFO_AUTH_INFO;
1172 typedef struct trusted_domain_info_full_info {
1173 TRUSTED_DOMAIN_INFO_EX info_ex;
1174 TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset;
1175 TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info;
1176 } TRUSTED_DOMAIN_INFO_FULL_INFO;
1178 typedef struct trusted_domain_info_11 {
1179 TRUSTED_DOMAIN_INFO_EX info_ex;
1180 LSA_DATA_BUF2 data1;
1181 } TRUSTED_DOMAIN_INFO_11;
1183 typedef struct trusted_domain_info_all {
1184 TRUSTED_DOMAIN_INFO_EX info_ex;
1185 LSA_DATA_BUF2 data1;
1186 TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset;
1187 TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info;
1188 } TRUSTED_DOMAIN_INFO_ALL;
1190 /* LSA_TRUSTED_DOMAIN_INFO */
1191 typedef union lsa_trusted_domain_info
1193 uint16 info_class;
1194 TRUSTED_DOMAIN_INFO_NAME name;
1195 /* deprecated - gd
1196 TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO controllers; */
1197 TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset;
1198 TRUSTED_DOMAIN_INFO_PASSWORD password;
1199 TRUSTED_DOMAIN_INFO_BASIC basic;
1200 TRUSTED_DOMAIN_INFO_EX info_ex;
1201 TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info;
1202 TRUSTED_DOMAIN_INFO_FULL_INFO full_info;
1203 TRUSTED_DOMAIN_INFO_11 info11;
1204 TRUSTED_DOMAIN_INFO_ALL info_all;
1206 } LSA_TRUSTED_DOMAIN_INFO;
1208 /* LSA_R_QUERY_TRUSTED_DOMAIN_INFO - LSA query trusted domain info */
1209 typedef struct r_lsa_query_trusted_domain_info
1211 LSA_TRUSTED_DOMAIN_INFO *info;
1212 NTSTATUS status;
1213 } LSA_R_QUERY_TRUSTED_DOMAIN_INFO;
1215 typedef struct dom_info_kerberos {
1216 uint32 enforce_restrictions;
1217 NTTIME service_tkt_lifetime;
1218 NTTIME user_tkt_lifetime;
1219 NTTIME user_tkt_renewaltime;
1220 NTTIME clock_skew;
1221 NTTIME unknown6;
1222 } LSA_DOM_INFO_POLICY_KERBEROS;
1224 typedef struct dom_info_efs {
1225 uint32 blob_len;
1226 UNISTR2 efs_blob;
1227 } LSA_DOM_INFO_POLICY_EFS;
1229 typedef struct lsa_dom_info_union {
1230 uint16 info_class;
1231 LSA_DOM_INFO_POLICY_EFS efs_policy;
1232 LSA_DOM_INFO_POLICY_KERBEROS krb_policy;
1233 } LSA_DOM_INFO_UNION;
1235 /* LSA_Q_QUERY_DOM_INFO_POLICY - LSA query info */
1236 typedef struct lsa_q_query_dom_info_policy
1238 POLICY_HND pol; /* policy handle */
1239 uint16 info_class; /* info class */
1240 } LSA_Q_QUERY_DOM_INFO_POLICY;
1242 typedef struct lsa_r_query_dom_info_policy
1244 LSA_DOM_INFO_UNION *info;
1245 NTSTATUS status;
1246 } LSA_R_QUERY_DOM_INFO_POLICY;
1249 #endif /* _RPC_LSA_H */