r13439: Fix NET_SAM_LOGON_EX.
[Samba/bb.git] / source3 / include / rpc_lsa.h
blobc8d6a210b51eb3e1806849ea1f72d9c47533699a
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 2 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, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _RPC_LSA_H /* _RPC_LSA_H */
25 #define _RPC_LSA_H
27 /* Opcodes available on PIPE_LSARPC */
29 #if 0 /* UNIMPLEMENTED */
31 #define LSA_LOOKUPSIDS2 0x39
33 #endif
35 #define LSA_CLOSE 0x00
36 #define LSA_DELETE 0x01
37 #define LSA_ENUM_PRIVS 0x02
38 #define LSA_QUERYSECOBJ 0x03
39 #define LSA_SETSECOBJ 0x04
40 #define LSA_CHANGEPASSWORD 0x05
41 #define LSA_OPENPOLICY 0x06
42 #define LSA_QUERYINFOPOLICY 0x07
43 #define LSA_SETINFOPOLICY 0x08
44 #define LSA_CLEARAUDITLOG 0x09
45 #define LSA_CREATEACCOUNT 0x0a
46 #define LSA_ENUM_ACCOUNTS 0x0b
47 #define LSA_CREATETRUSTDOM 0x0c /* TODO: implement this one -- jerry */
48 #define LSA_ENUMTRUSTDOM 0x0d
49 #define LSA_LOOKUPNAMES 0x0e
50 #define LSA_LOOKUPSIDS 0x0f
51 #define LSA_CREATESECRET 0x10 /* TODO: implement this one -- jerry */
52 #define LSA_OPENACCOUNT 0x11
53 #define LSA_ENUMPRIVSACCOUNT 0x12
54 #define LSA_ADDPRIVS 0x13
55 #define LSA_REMOVEPRIVS 0x14
56 #define LSA_GETQUOTAS 0x15
57 #define LSA_SETQUOTAS 0x16
58 #define LSA_GETSYSTEMACCOUNT 0x17
59 #define LSA_SETSYSTEMACCOUNT 0x18
60 #define LSA_OPENTRUSTDOM 0x19 /* TODO: implement this one -- jerry */
61 #define LSA_QUERYTRUSTDOMINFO 0x1a
62 #define LSA_SETINFOTRUSTDOM 0x1b
63 #define LSA_OPENSECRET 0x1c /* TODO: implement this one -- jerry */
64 #define LSA_SETSECRET 0x1d /* TODO: implement this one -- jerry */
65 #define LSA_QUERYSECRET 0x1e
66 #define LSA_LOOKUPPRIVVALUE 0x1f
67 #define LSA_LOOKUPPRIVNAME 0x20
68 #define LSA_PRIV_GET_DISPNAME 0x21
69 #define LSA_DELETEOBJECT 0x22 /* TODO: implement this one -- jerry */
70 #define LSA_ENUMACCTWITHRIGHT 0x23 /* TODO: implement this one -- jerry */
71 #define LSA_ENUMACCTRIGHTS 0x24
72 #define LSA_ADDACCTRIGHTS 0x25
73 #define LSA_REMOVEACCTRIGHTS 0x26
74 #define LSA_QUERYTRUSTDOMINFOBYSID 0x27
75 #define LSA_SETTRUSTDOMINFO 0x28
76 #define LSA_DELETETRUSTDOM 0x29
77 #define LSA_STOREPRIVDATA 0x2a
78 #define LSA_RETRPRIVDATA 0x2b
79 #define LSA_OPENPOLICY2 0x2c
80 #define LSA_UNK_GET_CONNUSER 0x2d /* LsaGetConnectedCredentials ? */
81 #define LSA_QUERYINFO2 0x2e
82 #define LSA_QUERYTRUSTDOMINFOBYNAME 0x30
83 #define LSA_QUERYDOMINFOPOL 0x35
84 #define LSA_OPENTRUSTDOMBYNAME 0x37
86 /* XXXX these are here to get a compile! */
87 #define LSA_LOOKUPRIDS 0xFD
89 /* DOM_QUERY - info class 3 and 5 LSA Query response */
90 typedef struct dom_query_info
92 uint16 uni_dom_max_len; /* domain name string length * 2 */
93 uint16 uni_dom_str_len; /* domain name string length * 2 */
94 uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */
95 uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */
96 UNISTR2 uni_domain_name; /* domain name (unicode string) */
97 DOM_SID2 dom_sid; /* domain SID */
99 } DOM_QUERY;
101 /* level 5 is same as level 3. */
102 typedef DOM_QUERY DOM_QUERY_3;
103 typedef DOM_QUERY DOM_QUERY_5;
105 /* level 2 is auditing settings */
106 typedef struct dom_query_2
108 uint32 auditing_enabled;
109 uint32 count1; /* usualy 7, at least on nt4sp4 */
110 uint32 count2; /* the same */
111 uint32 *auditsettings;
112 } DOM_QUERY_2;
114 /* level 6 is server role information */
115 typedef struct dom_query_6
117 uint16 server_role; /* 2=backup, 3=primary */
118 } DOM_QUERY_6;
120 typedef struct seq_qos_info
122 uint32 len; /* 12 */
123 uint16 sec_imp_level; /* 0x02 - impersonation level */
124 uint8 sec_ctxt_mode; /* 0x01 - context tracking mode */
125 uint8 effective_only; /* 0x00 - effective only */
127 } LSA_SEC_QOS;
129 typedef struct obj_attr_info
131 uint32 len; /* 0x18 - length (in bytes) inc. the length field. */
132 uint32 ptr_root_dir; /* 0 - root directory (pointer) */
133 uint32 ptr_obj_name; /* 0 - object name (pointer) */
134 uint32 attributes; /* 0 - attributes (undocumented) */
135 uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */
136 uint32 ptr_sec_qos; /* security quality of service */
137 LSA_SEC_QOS *sec_qos;
139 } LSA_OBJ_ATTR;
141 /* LSA_Q_OPEN_POL - LSA Query Open Policy */
142 typedef struct lsa_q_open_pol_info
144 uint32 ptr; /* undocumented buffer pointer */
145 uint16 system_name; /* 0x5c - system name */
146 LSA_OBJ_ATTR attr ; /* object attributes */
148 uint32 des_access; /* desired access attributes */
150 } LSA_Q_OPEN_POL;
152 /* LSA_R_OPEN_POL - response to LSA Open Policy */
153 typedef struct lsa_r_open_pol_info
155 POLICY_HND pol; /* policy handle */
156 NTSTATUS status; /* return code */
158 } LSA_R_OPEN_POL;
160 /* LSA_Q_OPEN_POL2 - LSA Query Open Policy */
161 typedef struct lsa_q_open_pol2_info
163 uint32 ptr; /* undocumented buffer pointer */
164 UNISTR2 uni_server_name; /* server name, starting with two '\'s */
165 LSA_OBJ_ATTR attr ; /* object attributes */
167 uint32 des_access; /* desired access attributes */
169 } LSA_Q_OPEN_POL2;
171 /* LSA_R_OPEN_POL2 - response to LSA Open Policy */
172 typedef struct lsa_r_open_pol2_info
174 POLICY_HND pol; /* policy handle */
175 NTSTATUS status; /* return code */
177 } LSA_R_OPEN_POL2;
180 #define POLICY_VIEW_LOCAL_INFORMATION 0x00000001
181 #define POLICY_VIEW_AUDIT_INFORMATION 0x00000002
182 #define POLICY_GET_PRIVATE_INFORMATION 0x00000004
183 #define POLICY_TRUST_ADMIN 0x00000008
184 #define POLICY_CREATE_ACCOUNT 0x00000010
185 #define POLICY_CREATE_SECRET 0x00000020
186 #define POLICY_CREATE_PRIVILEGE 0x00000040
187 #define POLICY_SET_DEFAULT_QUOTA_LIMITS 0x00000080
188 #define POLICY_SET_AUDIT_REQUIREMENTS 0x00000100
189 #define POLICY_AUDIT_LOG_ADMIN 0x00000200
190 #define POLICY_SERVER_ADMIN 0x00000400
191 #define POLICY_LOOKUP_NAMES 0x00000800
193 #define POLICY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS |\
194 POLICY_VIEW_LOCAL_INFORMATION |\
195 POLICY_VIEW_AUDIT_INFORMATION |\
196 POLICY_GET_PRIVATE_INFORMATION |\
197 POLICY_TRUST_ADMIN |\
198 POLICY_CREATE_ACCOUNT |\
199 POLICY_CREATE_SECRET |\
200 POLICY_CREATE_PRIVILEGE |\
201 POLICY_SET_DEFAULT_QUOTA_LIMITS |\
202 POLICY_SET_AUDIT_REQUIREMENTS |\
203 POLICY_AUDIT_LOG_ADMIN |\
204 POLICY_SERVER_ADMIN |\
205 POLICY_LOOKUP_NAMES )
208 #define POLICY_READ ( STANDARD_RIGHTS_READ_ACCESS |\
209 POLICY_VIEW_AUDIT_INFORMATION |\
210 POLICY_GET_PRIVATE_INFORMATION)
212 #define POLICY_WRITE ( STD_RIGHT_READ_CONTROL_ACCESS |\
213 POLICY_TRUST_ADMIN |\
214 POLICY_CREATE_ACCOUNT |\
215 POLICY_CREATE_SECRET |\
216 POLICY_CREATE_PRIVILEGE |\
217 POLICY_SET_DEFAULT_QUOTA_LIMITS |\
218 POLICY_SET_AUDIT_REQUIREMENTS |\
219 POLICY_AUDIT_LOG_ADMIN |\
220 POLICY_SERVER_ADMIN)
222 #define POLICY_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS |\
223 POLICY_VIEW_LOCAL_INFORMATION |\
224 POLICY_LOOKUP_NAMES )
226 /* LSA_Q_QUERY_SEC_OBJ - LSA query security */
227 typedef struct lsa_query_sec_obj_info
229 POLICY_HND pol; /* policy handle */
230 uint32 sec_info;
232 } LSA_Q_QUERY_SEC_OBJ;
234 /* LSA_R_QUERY_SEC_OBJ - probably an open */
235 typedef struct r_lsa_query_sec_obj_info
237 uint32 ptr;
238 SEC_DESC_BUF *buf;
240 NTSTATUS status; /* return status */
242 } LSA_R_QUERY_SEC_OBJ;
244 /* LSA_Q_QUERY_INFO - LSA query info policy */
245 typedef struct lsa_query_info
247 POLICY_HND pol; /* policy handle */
248 uint16 info_class; /* info class */
250 } LSA_Q_QUERY_INFO;
252 /* LSA_INFO_UNION */
253 typedef union lsa_info_union
255 DOM_QUERY_2 id2;
256 DOM_QUERY_3 id3;
257 DOM_QUERY_5 id5;
258 DOM_QUERY_6 id6;
259 } LSA_INFO_UNION;
261 /* LSA_R_QUERY_INFO - response to LSA query info policy */
262 typedef struct lsa_r_query_info
264 uint32 undoc_buffer; /* undocumented buffer pointer */
265 uint16 info_class; /* info class (same as info class in request) */
267 LSA_INFO_UNION dom;
269 NTSTATUS status; /* return code */
271 } LSA_R_QUERY_INFO;
273 /* LSA_DNS_DOM_INFO - DNS domain info - info class 12*/
274 typedef struct lsa_dns_dom_info
276 UNIHDR hdr_nb_dom_name; /* netbios domain name */
277 UNIHDR hdr_dns_dom_name;
278 UNIHDR hdr_forest_name;
280 struct uuid dom_guid; /* domain GUID */
282 UNISTR2 uni_nb_dom_name;
283 UNISTR2 uni_dns_dom_name;
284 UNISTR2 uni_forest_name;
286 uint32 ptr_dom_sid;
287 DOM_SID2 dom_sid; /* domain SID */
288 } LSA_DNS_DOM_INFO;
290 typedef union lsa_info2_union
292 LSA_DNS_DOM_INFO dns_dom_info;
293 } LSA_INFO2_UNION;
295 /* LSA_Q_QUERY_INFO2 - LSA query info */
296 typedef struct lsa_q_query_info2
298 POLICY_HND pol; /* policy handle */
299 uint16 info_class; /* info class */
300 } LSA_Q_QUERY_INFO2;
302 typedef struct lsa_r_query_info2
304 uint32 ptr; /* pointer to info struct */
305 uint16 info_class;
306 LSA_INFO2_UNION info; /* so far the only one */
307 NTSTATUS status;
308 } LSA_R_QUERY_INFO2;
310 /*******************************************************/
312 typedef struct {
313 POLICY_HND pol;
314 uint32 enum_context;
315 uint32 preferred_len; /* preferred maximum length */
316 } LSA_Q_ENUM_TRUST_DOM;
318 typedef struct {
319 UNISTR4 name;
320 DOM_SID2 *sid;
321 } DOMAIN_INFO;
323 typedef struct {
324 uint32 count;
325 DOMAIN_INFO *domains;
326 } DOMAIN_LIST;
328 typedef struct {
329 uint32 enum_context;
330 uint32 count;
331 DOMAIN_LIST *domlist;
332 NTSTATUS status;
333 } LSA_R_ENUM_TRUST_DOM;
335 /*******************************************************/
337 /* LSA_Q_CLOSE */
338 typedef struct lsa_q_close_info
340 POLICY_HND pol; /* policy handle */
342 } LSA_Q_CLOSE;
344 /* LSA_R_CLOSE */
345 typedef struct lsa_r_close_info
347 POLICY_HND pol; /* policy handle. should be all zeros. */
349 NTSTATUS status; /* return code */
351 } LSA_R_CLOSE;
354 #define MAX_REF_DOMAINS 32
356 /* DOM_TRUST_HDR */
357 typedef struct dom_trust_hdr
359 UNIHDR hdr_dom_name; /* referenced domain unicode string headers */
360 uint32 ptr_dom_sid;
362 } DOM_TRUST_HDR;
364 /* DOM_TRUST_INFO */
365 typedef struct dom_trust_info
367 UNISTR2 uni_dom_name; /* domain name unicode string */
368 DOM_SID2 ref_dom ; /* referenced domain SID */
370 } DOM_TRUST_INFO;
372 /* DOM_R_REF */
373 typedef struct dom_ref_info
375 uint32 num_ref_doms_1; /* num referenced domains */
376 uint32 ptr_ref_dom; /* pointer to referenced domains */
377 uint32 max_entries; /* 32 - max number of entries */
378 uint32 num_ref_doms_2; /* num referenced domains */
380 DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */
381 DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */
383 } DOM_R_REF;
385 /* the domain_idx points to a SID associated with the name */
387 /* LSA_TRANS_NAME - translated name */
388 typedef struct lsa_trans_name_info
390 uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */
391 UNIHDR hdr_name;
392 uint32 domain_idx; /* index into DOM_R_REF array of SIDs */
394 } LSA_TRANS_NAME;
396 /* This number is based on Win2k and later maximum response allowed */
397 #define MAX_LOOKUP_SIDS 20480 /* 0x5000 */
399 /* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */
400 typedef struct lsa_trans_name_enum_info
402 uint32 num_entries;
403 uint32 ptr_trans_names;
404 uint32 num_entries2;
406 LSA_TRANS_NAME *name; /* translated names */
407 UNISTR2 *uni_name;
409 } LSA_TRANS_NAME_ENUM;
411 /* LSA_SID_ENUM - LSA SID enumeration container */
412 typedef struct lsa_sid_enum_info
414 uint32 num_entries;
415 uint32 ptr_sid_enum;
416 uint32 num_entries2;
418 uint32 *ptr_sid; /* domain SID pointers to be looked up. */
419 DOM_SID2 *sid; /* domain SIDs to be looked up. */
421 } LSA_SID_ENUM;
423 /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
424 typedef struct lsa_q_lookup_sids
426 POLICY_HND pol; /* policy handle */
427 LSA_SID_ENUM sids;
428 LSA_TRANS_NAME_ENUM names;
429 uint16 level;
430 uint32 mapped_count;
432 } LSA_Q_LOOKUP_SIDS;
434 /* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
435 typedef struct lsa_r_lookup_sids
437 uint32 ptr_dom_ref;
438 DOM_R_REF *dom_ref; /* domain reference info */
440 LSA_TRANS_NAME_ENUM *names;
441 uint32 mapped_count;
443 NTSTATUS status; /* return code */
445 } LSA_R_LOOKUP_SIDS;
447 /* LSA_Q_LOOKUP_NAMES - LSA Lookup NAMEs */
448 typedef struct lsa_q_lookup_names
450 POLICY_HND pol; /* policy handle */
451 uint32 num_entries;
452 uint32 num_entries2;
453 UNIHDR *hdr_name; /* name buffer pointers */
454 UNISTR2 *uni_name; /* names to be looked up */
456 uint32 num_trans_entries;
457 uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */
458 uint32 lookup_level;
459 uint32 mapped_count;
461 } LSA_Q_LOOKUP_NAMES;
463 /* LSA_R_LOOKUP_NAMES - response to LSA Lookup NAMEs by name */
464 typedef struct lsa_r_lookup_names
466 uint32 ptr_dom_ref;
467 DOM_R_REF *dom_ref; /* domain reference info */
469 uint32 num_entries;
470 uint32 ptr_entries;
471 uint32 num_entries2;
472 DOM_RID2 *dom_rid; /* domain RIDs being looked up */
474 uint32 mapped_count;
476 NTSTATUS status; /* return code */
477 } LSA_R_LOOKUP_NAMES;
479 typedef struct lsa_enum_priv_entry
481 UNIHDR hdr_name;
482 uint32 luid_low;
483 uint32 luid_high;
484 UNISTR2 name;
486 } LSA_PRIV_ENTRY;
488 /* LSA_Q_ENUM_PRIVS - LSA enum privileges */
489 typedef struct lsa_q_enum_privs
491 POLICY_HND pol; /* policy handle */
492 uint32 enum_context;
493 uint32 pref_max_length;
494 } LSA_Q_ENUM_PRIVS;
496 typedef struct lsa_r_enum_privs
498 uint32 enum_context;
499 uint32 count;
500 uint32 ptr;
501 uint32 count1;
503 LSA_PRIV_ENTRY *privs;
505 NTSTATUS status;
506 } LSA_R_ENUM_PRIVS;
508 /* LSA_Q_ENUM_ACCT_RIGHTS - LSA enum account rights */
509 typedef struct
511 POLICY_HND pol; /* policy handle */
512 DOM_SID2 sid;
513 } LSA_Q_ENUM_ACCT_RIGHTS;
515 /* LSA_R_ENUM_ACCT_RIGHTS - LSA enum account rights */
516 typedef struct
518 uint32 count;
519 UNISTR4_ARRAY *rights;
520 NTSTATUS status;
521 } LSA_R_ENUM_ACCT_RIGHTS;
524 /* LSA_Q_ADD_ACCT_RIGHTS - LSA add account rights */
525 typedef struct
527 POLICY_HND pol; /* policy handle */
528 DOM_SID2 sid;
529 uint32 count;
530 UNISTR4_ARRAY *rights;
531 } LSA_Q_ADD_ACCT_RIGHTS;
533 /* LSA_R_ADD_ACCT_RIGHTS - LSA add account rights */
534 typedef struct
536 NTSTATUS status;
537 } LSA_R_ADD_ACCT_RIGHTS;
540 /* LSA_Q_REMOVE_ACCT_RIGHTS - LSA remove account rights */
541 typedef struct
543 POLICY_HND pol; /* policy handle */
544 DOM_SID2 sid;
545 uint32 removeall;
546 uint32 count;
547 UNISTR4_ARRAY *rights;
548 } LSA_Q_REMOVE_ACCT_RIGHTS;
550 /* LSA_R_REMOVE_ACCT_RIGHTS - LSA remove account rights */
551 typedef struct
553 NTSTATUS status;
554 } LSA_R_REMOVE_ACCT_RIGHTS;
557 /* LSA_Q_PRIV_GET_DISPNAME - LSA get privilege display name */
558 typedef struct lsa_q_priv_get_dispname
560 POLICY_HND pol; /* policy handle */
561 UNIHDR hdr_name;
562 UNISTR2 name;
563 uint16 lang_id;
564 uint16 lang_id_sys;
565 } LSA_Q_PRIV_GET_DISPNAME;
567 typedef struct lsa_r_priv_get_dispname
569 uint32 ptr_info;
570 UNIHDR hdr_desc;
571 UNISTR2 desc;
572 /* Don't align ! */
573 uint16 lang_id;
574 /* align */
575 NTSTATUS status;
576 } LSA_R_PRIV_GET_DISPNAME;
578 /* LSA_Q_ENUM_ACCOUNTS */
579 typedef struct lsa_q_enum_accounts
581 POLICY_HND pol; /* policy handle */
582 uint32 enum_context;
583 uint32 pref_max_length;
584 } LSA_Q_ENUM_ACCOUNTS;
586 /* LSA_R_ENUM_ACCOUNTS */
587 typedef struct lsa_r_enum_accounts
589 uint32 enum_context;
590 LSA_SID_ENUM sids;
591 NTSTATUS status;
592 } LSA_R_ENUM_ACCOUNTS;
594 /* LSA_Q_UNK_GET_CONNUSER - gets username\domain of connected user
595 called when "Take Ownership" is clicked -SK */
596 typedef struct lsa_q_unk_get_connuser
598 uint32 ptr_srvname;
599 UNISTR2 uni2_srvname;
600 uint32 unk1; /* 3 unknown uint32's are seen right after uni2_srvname */
601 uint32 unk2; /* unk2 appears to be a ptr, unk1 = unk3 = 0 usually */
602 uint32 unk3;
603 } LSA_Q_UNK_GET_CONNUSER;
605 /* LSA_R_UNK_GET_CONNUSER */
606 typedef struct lsa_r_unk_get_connuser
608 uint32 ptr_user_name;
609 UNIHDR hdr_user_name;
610 UNISTR2 uni2_user_name;
612 uint32 unk1;
614 uint32 ptr_dom_name;
615 UNIHDR hdr_dom_name;
616 UNISTR2 uni2_dom_name;
618 NTSTATUS status;
619 } LSA_R_UNK_GET_CONNUSER;
622 typedef struct lsa_q_createaccount
624 POLICY_HND pol; /* policy handle */
625 DOM_SID2 sid;
626 uint32 access; /* access */
627 } LSA_Q_CREATEACCOUNT;
629 typedef struct lsa_r_createaccount
631 POLICY_HND pol; /* policy handle */
632 NTSTATUS status;
633 } LSA_R_CREATEACCOUNT;
636 typedef struct lsa_q_openaccount
638 POLICY_HND pol; /* policy handle */
639 DOM_SID2 sid;
640 uint32 access; /* desired access */
641 } LSA_Q_OPENACCOUNT;
643 typedef struct lsa_r_openaccount
645 POLICY_HND pol; /* policy handle */
646 NTSTATUS status;
647 } LSA_R_OPENACCOUNT;
649 typedef struct lsa_q_enumprivsaccount
651 POLICY_HND pol; /* policy handle */
652 } LSA_Q_ENUMPRIVSACCOUNT;
654 typedef struct lsa_r_enumprivsaccount
656 uint32 ptr;
657 uint32 count;
658 PRIVILEGE_SET set;
659 NTSTATUS status;
660 } LSA_R_ENUMPRIVSACCOUNT;
662 typedef struct lsa_q_getsystemaccount
664 POLICY_HND pol; /* policy handle */
665 } LSA_Q_GETSYSTEMACCOUNT;
667 typedef struct lsa_r_getsystemaccount
669 uint32 access;
670 NTSTATUS status;
671 } LSA_R_GETSYSTEMACCOUNT;
674 typedef struct lsa_q_setsystemaccount
676 POLICY_HND pol; /* policy handle */
677 uint32 access;
678 } LSA_Q_SETSYSTEMACCOUNT;
680 typedef struct lsa_r_setsystemaccount
682 NTSTATUS status;
683 } LSA_R_SETSYSTEMACCOUNT;
685 typedef struct {
686 UNIHDR hdr;
687 UNISTR2 unistring;
688 } LSA_STRING;
690 typedef struct {
691 POLICY_HND pol; /* policy handle */
692 LSA_STRING privname;
693 } LSA_Q_LOOKUP_PRIV_VALUE;
695 typedef struct {
696 LUID luid;
697 NTSTATUS status;
698 } LSA_R_LOOKUP_PRIV_VALUE;
700 typedef struct lsa_q_addprivs
702 POLICY_HND pol; /* policy handle */
703 uint32 count;
704 PRIVILEGE_SET set;
705 } LSA_Q_ADDPRIVS;
707 typedef struct lsa_r_addprivs
709 NTSTATUS status;
710 } LSA_R_ADDPRIVS;
713 typedef struct lsa_q_removeprivs
715 POLICY_HND pol; /* policy handle */
716 uint32 allrights;
717 uint32 ptr;
718 uint32 count;
719 PRIVILEGE_SET set;
720 } LSA_Q_REMOVEPRIVS;
722 typedef struct lsa_r_removeprivs
724 NTSTATUS status;
725 } LSA_R_REMOVEPRIVS;
727 /*******************************************************/
728 #if 0 /* jerry, I think this not correct - gd */
729 typedef struct {
730 POLICY_HND handle;
731 uint32 count; /* ??? this is what ethereal calls it */
732 DOM_SID sid;
733 } LSA_Q_OPEN_TRUSTED_DOMAIN;
734 #endif
736 /* LSA_Q_OPEN_TRUSTED_DOMAIN - LSA Query Open Trusted Domain */
737 typedef struct lsa_q_open_trusted_domain
739 POLICY_HND pol; /* policy handle */
740 DOM_SID2 sid; /* domain sid */
741 uint32 access_mask; /* access mask */
743 } LSA_Q_OPEN_TRUSTED_DOMAIN;
745 /* LSA_R_OPEN_TRUSTED_DOMAIN - response to LSA Query Open Trusted Domain */
746 typedef struct {
747 POLICY_HND handle; /* trustdom policy handle */
748 NTSTATUS status; /* return code */
749 } LSA_R_OPEN_TRUSTED_DOMAIN;
752 /*******************************************************/
754 /* LSA_Q_OPEN_TRUSTED_DOMAIN_BY_NAME - LSA Query Open Trusted Domain by Name*/
755 typedef struct lsa_q_open_trusted_domain_by_name
757 POLICY_HND pol; /* policy handle */
758 LSA_STRING name; /* domain name */
759 uint32 access_mask; /* access mask */
761 } LSA_Q_OPEN_TRUSTED_DOMAIN_BY_NAME;
763 /* LSA_R_OPEN_TRUSTED_DOMAIN_BY_NAME - response to LSA Query Open Trusted Domain by Name */
764 typedef struct {
765 POLICY_HND handle; /* trustdom policy handle */
766 NTSTATUS status; /* return code */
767 } LSA_R_OPEN_TRUSTED_DOMAIN_BY_NAME;
770 /*******************************************************/
773 typedef struct {
774 POLICY_HND handle;
775 UNISTR4 secretname;
776 uint32 access;
777 } LSA_Q_OPEN_SECRET;
779 typedef struct {
780 POLICY_HND handle;
781 NTSTATUS status;
782 } LSA_R_OPEN_SECRET;
785 /*******************************************************/
787 typedef struct {
788 POLICY_HND handle;
789 } LSA_Q_DELETE_OBJECT;
791 typedef struct {
792 NTSTATUS status;
793 } LSA_R_DELETE_OBJECT;
796 /*******************************************************/
798 typedef struct {
799 POLICY_HND handle;
800 UNISTR4 secretname;
801 uint32 access;
802 } LSA_Q_CREATE_SECRET;
804 typedef struct {
805 POLICY_HND handle;
806 NTSTATUS status;
807 } LSA_R_CREATE_SECRET;
810 /*******************************************************/
812 typedef struct {
813 POLICY_HND handle;
814 UNISTR4 secretname;
815 uint32 access;
816 } LSA_Q_CREATE_TRUSTED_DOMAIN;
818 typedef struct {
819 POLICY_HND handle;
820 NTSTATUS status;
821 } LSA_R_CREATE_TRUSTED_DOMAIN;
824 /*******************************************************/
826 typedef struct {
827 uint32 size; /* size is written on the wire twice so I
828 can only assume that one is supposed to
829 be a max length and one is a size */
830 UNISTR2 *data; /* not really a UNICODE string but the parsing
831 is the same */
832 } LSA_DATA_BLOB;
834 typedef struct {
835 POLICY_HND handle;
836 LSA_DATA_BLOB *old_value;
837 LSA_DATA_BLOB *new_value;
838 } LSA_Q_SET_SECRET;
840 typedef struct {
841 NTSTATUS status;
842 } LSA_R_SET_SECRET;
844 /* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO - LSA query trusted domain info */
845 typedef struct lsa_query_trusted_domain_info
847 POLICY_HND pol; /* policy handle */
848 uint16 info_class; /* info class */
850 } LSA_Q_QUERY_TRUSTED_DOMAIN_INFO;
852 /* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_SID - LSA query trusted domain info */
853 typedef struct lsa_query_trusted_domain_info_by_sid
855 POLICY_HND pol; /* policy handle */
856 DOM_SID2 dom_sid; /* domain sid */
857 uint16 info_class; /* info class */
859 } LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_SID;
861 /* LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_NAME - LSA query trusted domain info */
862 typedef struct lsa_query_trusted_domain_info_by_name
864 POLICY_HND pol; /* policy handle */
865 LSA_STRING domain_name; /* domain name */
866 uint16 info_class; /* info class */
868 } LSA_Q_QUERY_TRUSTED_DOMAIN_INFO_BY_NAME;
870 typedef struct trusted_domain_info_name {
871 LSA_STRING netbios_name;
872 } TRUSTED_DOMAIN_INFO_NAME;
874 typedef struct trusted_domain_info_posix_offset {
875 uint32 posix_offset;
876 } TRUSTED_DOMAIN_INFO_POSIX_OFFSET;
878 typedef struct lsa_data_buf {
879 uint32 size;
880 uint32 offset;
881 uint32 length;
882 uint8 *data;
883 } LSA_DATA_BUF;
885 typedef struct lsa_data_buf_hdr {
886 uint32 length;
887 uint32 size;
888 uint32 data_ptr;
889 } LSA_DATA_BUF_HDR;
892 typedef struct lsa_data_buf2 {
893 uint32 size;
894 uint8 *data;
895 } LSA_DATA_BUF2;
897 typedef struct trusted_domain_info_password {
898 uint32 ptr_password;
899 uint32 ptr_old_password;
900 LSA_DATA_BUF_HDR password_hdr;
901 LSA_DATA_BUF_HDR old_password_hdr;
902 LSA_DATA_BUF password;
903 LSA_DATA_BUF old_password;
904 } TRUSTED_DOMAIN_INFO_PASSWORD;
906 typedef struct trusted_domain_info_basic {
907 LSA_STRING netbios_name;
908 DOM_SID2 sid;
909 } TRUSTED_DOMAIN_INFO_BASIC;
911 typedef struct trusted_domain_info_ex {
912 LSA_STRING domain_name;
913 LSA_STRING netbios_name;
914 DOM_SID2 sid;
915 uint32 trust_direction;
916 uint32 trust_type;
917 uint32 trust_attributes;
918 } TRUSTED_DOMAIN_INFO_EX;
920 typedef struct trust_domain_info_buffer {
921 NTTIME last_update_time;
922 uint32 secret_type;
923 LSA_DATA_BUF2 data;
924 } LSA_TRUSTED_DOMAIN_INFO_BUFFER;
926 typedef struct trusted_domain_info_auth_info {
927 uint32 incoming_count;
928 LSA_TRUSTED_DOMAIN_INFO_BUFFER incoming_current_auth_info;
929 LSA_TRUSTED_DOMAIN_INFO_BUFFER incoming_previous_auth_info;
930 uint32 outgoing_count;
931 LSA_TRUSTED_DOMAIN_INFO_BUFFER outgoing_current_auth_info;
932 LSA_TRUSTED_DOMAIN_INFO_BUFFER outgoing_previous_auth_info;
933 } TRUSTED_DOMAIN_INFO_AUTH_INFO;
935 typedef struct trusted_domain_info_full_info {
936 TRUSTED_DOMAIN_INFO_EX info_ex;
937 TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset;
938 TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info;
939 } TRUSTED_DOMAIN_INFO_FULL_INFO;
941 typedef struct trusted_domain_info_11 {
942 TRUSTED_DOMAIN_INFO_EX info_ex;
943 LSA_DATA_BUF2 data1;
944 } TRUSTED_DOMAIN_INFO_11;
946 typedef struct trusted_domain_info_all {
947 TRUSTED_DOMAIN_INFO_EX info_ex;
948 LSA_DATA_BUF2 data1;
949 TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset;
950 TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info;
951 } TRUSTED_DOMAIN_INFO_ALL;
953 /* LSA_TRUSTED_DOMAIN_INFO */
954 typedef union lsa_trusted_domain_info
956 uint16 info_class;
957 TRUSTED_DOMAIN_INFO_NAME name;
958 /* deprecated - gd
959 TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO controllers; */
960 TRUSTED_DOMAIN_INFO_POSIX_OFFSET posix_offset;
961 TRUSTED_DOMAIN_INFO_PASSWORD password;
962 TRUSTED_DOMAIN_INFO_BASIC basic;
963 TRUSTED_DOMAIN_INFO_EX info_ex;
964 TRUSTED_DOMAIN_INFO_AUTH_INFO auth_info;
965 TRUSTED_DOMAIN_INFO_FULL_INFO full_info;
966 TRUSTED_DOMAIN_INFO_11 info11;
967 TRUSTED_DOMAIN_INFO_ALL info_all;
969 } LSA_TRUSTED_DOMAIN_INFO;
971 /* LSA_R_QUERY_TRUSTED_DOMAIN_INFO - LSA query trusted domain info */
972 typedef struct r_lsa_query_trusted_domain_info
974 LSA_TRUSTED_DOMAIN_INFO *info;
975 NTSTATUS status;
976 } LSA_R_QUERY_TRUSTED_DOMAIN_INFO;
978 typedef struct dom_info_kerberos {
979 uint32 enforce_restrictions;
980 NTTIME service_tkt_lifetime;
981 NTTIME user_tkt_lifetime;
982 NTTIME user_tkt_renewaltime;
983 NTTIME clock_skew;
984 NTTIME unknown6;
985 } LSA_DOM_INFO_POLICY_KERBEROS;
987 typedef struct dom_info_efs {
988 uint32 blob_len;
989 UNISTR2 efs_blob;
990 } LSA_DOM_INFO_POLICY_EFS;
992 typedef struct lsa_dom_info_union {
993 uint16 info_class;
994 LSA_DOM_INFO_POLICY_EFS efs_policy;
995 LSA_DOM_INFO_POLICY_KERBEROS krb_policy;
996 } LSA_DOM_INFO_UNION;
998 /* LSA_Q_QUERY_DOM_INFO_POLICY - LSA query info */
999 typedef struct lsa_q_query_dom_info_policy
1001 POLICY_HND pol; /* policy handle */
1002 uint16 info_class; /* info class */
1003 } LSA_Q_QUERY_DOM_INFO_POLICY;
1005 typedef struct lsa_r_query_dom_info_policy
1007 LSA_DOM_INFO_UNION *info;
1008 NTSTATUS status;
1009 } LSA_R_QUERY_DOM_INFO_POLICY;
1012 #endif /* _RPC_LSA_H */