253b6d780c82d0a5a16ff9317d914c78a0b80735
[ira/wip.git] / librpc / idl / lsa.idl
1 #include "idl_types.h"
2
3 /*
4   lsa interface definition
5 */
6
7 import "misc.idl", "security.idl";
8
9 [ uuid("12345778-1234-abcd-ef00-0123456789ab"),
10   version(0.0),
11   endpoint("ncacn_np:[\\pipe\\lsarpc]","ncacn_np:[\\pipe\\netlogon]","ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:", "ncalrpc:"),
12   pointer_default(unique),
13   helpstring("Local Security Authority")
14 ] interface lsarpc
15 {
16         typedef bitmap security_secinfo security_secinfo;
17         typedef bitmap kerb_EncTypes kerb_EncTypes;
18
19         typedef [public] struct {
20                 [value(2*strlen_m(string))] uint16 length;
21                 [value(2*strlen_m(string))] uint16 size;
22                 [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
23         } lsa_String;
24
25         typedef [public] struct {
26                 [value(2*strlen_m(string))] uint16 length;
27                 [value(2*strlen_m_term(string))] uint16 size;
28                 [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
29         } lsa_StringLarge;
30
31         typedef [public] struct {
32                 uint32 count;
33                 [size_is(count)] lsa_String *names;
34         } lsa_Strings;
35
36         typedef [public] struct {
37                 [value(strlen_m(string))] uint16 length;
38                 [value(strlen_m(string))] uint16 size;
39                 [charset(DOS),size_is(size),length_is(length)] uint8 *string;
40         } lsa_AsciiString;
41
42         typedef [public] struct {
43                 [value(strlen_m(string))] uint16 length;
44                 [value(strlen_m_term(string))] uint16 size;
45                 [charset(DOS),size_is(size),length_is(length)] uint8 *string;
46         } lsa_AsciiStringLarge;
47
48         typedef [public] struct {
49                 uint16 length;
50                 uint16 size;
51                 [size_is(size/2),length_is(length/2)] uint16 *array;
52         } lsa_BinaryString;
53
54         /******************/
55         /* Function: 0x00 */
56         NTSTATUS lsa_Close (
57                 [in,out]     policy_handle *handle
58                 );
59
60
61         /******************/
62         /* Function: 0x01 */
63         [public] NTSTATUS lsa_Delete (
64                 [in]     policy_handle *handle
65                 );
66
67
68         /******************/
69         /* Function: 0x02 */
70         typedef struct {
71                 uint32 low;
72                 uint32 high;
73         } lsa_LUID;
74
75         typedef struct {
76                 lsa_StringLarge name;
77                 lsa_LUID luid;
78         } lsa_PrivEntry;
79
80         typedef struct {
81                 uint32 count;
82                 [size_is(count)] lsa_PrivEntry *privs;
83         } lsa_PrivArray;
84
85         [public] NTSTATUS lsa_EnumPrivs (
86                 [in]            policy_handle *handle,
87                 [in,out,ref]    uint32 *resume_handle,
88                 [out,ref]       lsa_PrivArray *privs,
89                 [in]            uint32 max_count
90                 );
91
92         /******************/
93         /* Function: 0x03 */
94         NTSTATUS lsa_QuerySecurity (
95                 [in]            policy_handle *handle,
96                 [in]            security_secinfo sec_info,
97                 [out,ref]       sec_desc_buf **sdbuf
98                 );
99
100         /******************/
101         /* Function: 0x04 */
102         NTSTATUS lsa_SetSecObj(
103                 [in]            policy_handle *handle,
104                 [in]            security_secinfo sec_info,
105                 [in,ref]        sec_desc_buf *sdbuf
106                 );
107
108         /******************/
109         /* Function: 0x05 */
110         [todo] NTSTATUS lsa_ChangePassword ();
111
112
113         /******************/
114         /* Function: 0x06 */
115         typedef struct {
116                 uint32  len; /* ignored */
117                 uint16  impersonation_level;
118                 uint8   context_mode;
119                 uint8   effective_only;
120         } lsa_QosInfo;
121
122         typedef struct {
123                 uint32 len; /* ignored */
124                 uint8 *root_dir;
125                 [string,charset(UTF16)] uint16 *object_name;
126                 uint32 attributes;
127                 security_descriptor *sec_desc;
128                 lsa_QosInfo *sec_qos;
129         } lsa_ObjectAttribute;
130
131         typedef [public,bitmap32bit] bitmap {
132                 LSA_POLICY_VIEW_LOCAL_INFORMATION       = 0x00000001,
133                 LSA_POLICY_VIEW_AUDIT_INFORMATION       = 0x00000002,
134                 LSA_POLICY_GET_PRIVATE_INFORMATION      = 0x00000004,
135                 LSA_POLICY_TRUST_ADMIN                  = 0x00000008,
136                 LSA_POLICY_CREATE_ACCOUNT               = 0x00000010,
137                 LSA_POLICY_CREATE_SECRET                = 0x00000020,
138                 LSA_POLICY_CREATE_PRIVILEGE             = 0x00000040,
139                 LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS     = 0x00000080,
140                 LSA_POLICY_SET_AUDIT_REQUIREMENTS       = 0x00000100,
141                 LSA_POLICY_AUDIT_LOG_ADMIN              = 0x00000200,
142                 LSA_POLICY_SERVER_ADMIN                 = 0x00000400,
143                 LSA_POLICY_LOOKUP_NAMES                 = 0x00000800,
144                 LSA_POLICY_NOTIFICATION                 = 0x00001000
145         } lsa_PolicyAccessMask;
146
147         const int LSA_POLICY_ALL_ACCESS =
148                 (STANDARD_RIGHTS_REQUIRED_ACCESS        |
149                 LSA_POLICY_VIEW_LOCAL_INFORMATION       |
150                 LSA_POLICY_VIEW_AUDIT_INFORMATION       |
151                 LSA_POLICY_GET_PRIVATE_INFORMATION      |
152                 LSA_POLICY_TRUST_ADMIN                  |
153                 LSA_POLICY_CREATE_ACCOUNT               |
154                 LSA_POLICY_CREATE_SECRET                |
155                 LSA_POLICY_CREATE_PRIVILEGE             |
156                 LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS     |
157                 LSA_POLICY_SET_AUDIT_REQUIREMENTS       |
158                 LSA_POLICY_AUDIT_LOG_ADMIN              |
159                 LSA_POLICY_SERVER_ADMIN                 |
160                 LSA_POLICY_LOOKUP_NAMES);
161
162         const int LSA_POLICY_READ =
163                 (STANDARD_RIGHTS_READ_ACCESS            |
164                 LSA_POLICY_VIEW_LOCAL_INFORMATION       |
165                 LSA_POLICY_VIEW_AUDIT_INFORMATION       |
166                 LSA_POLICY_GET_PRIVATE_INFORMATION);
167
168         const int LSA_POLICY_WRITE =
169                 (STANDARD_RIGHTS_READ_ACCESS            |
170                 LSA_POLICY_TRUST_ADMIN                  |
171                 LSA_POLICY_CREATE_ACCOUNT               |
172                 LSA_POLICY_CREATE_SECRET                |
173                 LSA_POLICY_CREATE_PRIVILEGE             |
174                 LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS     |
175                 LSA_POLICY_SET_AUDIT_REQUIREMENTS       |
176                 LSA_POLICY_AUDIT_LOG_ADMIN              |
177                 LSA_POLICY_SERVER_ADMIN);
178
179         const int LSA_POLICY_EXECUTE =
180                 (STANDARD_RIGHTS_EXECUTE_ACCESS         |
181                 LSA_POLICY_VIEW_LOCAL_INFORMATION       |
182                 LSA_POLICY_LOOKUP_NAMES);
183
184         typedef [public,bitmap32bit] bitmap {
185                 LSA_ACCOUNT_VIEW                        = 0x00000001,
186                 LSA_ACCOUNT_ADJUST_PRIVILEGES           = 0x00000002,
187                 LSA_ACCOUNT_ADJUST_QUOTAS               = 0x00000004,
188                 LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS        = 0x00000008
189         } lsa_AccountAccessMask;
190
191         const int LSA_ACCOUNT_ALL_ACCESS =
192                 (STANDARD_RIGHTS_REQUIRED_ACCESS        |
193                 LSA_ACCOUNT_VIEW                        |
194                 LSA_ACCOUNT_ADJUST_PRIVILEGES           |
195                 LSA_ACCOUNT_ADJUST_QUOTAS               |
196                 LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS);
197
198         const int LSA_ACCOUNT_READ =
199                 (STANDARD_RIGHTS_READ_ACCESS            |
200                 LSA_ACCOUNT_VIEW);
201
202         const int LSA_ACCOUNT_WRITE =
203                 (STANDARD_RIGHTS_READ_ACCESS            |
204                 LSA_ACCOUNT_ADJUST_PRIVILEGES           |
205                 LSA_ACCOUNT_ADJUST_QUOTAS               |
206                 LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS);
207
208         const int LSA_ACCOUNT_EXECUTE =
209                 (STANDARD_RIGHTS_EXECUTE_ACCESS);
210
211         typedef [public,bitmap32bit] bitmap {
212                 LSA_SECRET_SET_VALUE                    = 0x00000001,
213                 LSA_SECRET_QUERY_VALUE                  = 0x00000002
214         } lsa_SecretAccessMask;
215
216         typedef [public,bitmap32bit] bitmap {
217                 LSA_TRUSTED_QUERY_DOMAIN_NAME           = 0x00000001,
218                 LSA_TRUSTED_QUERY_CONTROLLERS           = 0x00000002,
219                 LSA_TRUSTED_SET_CONTROLLERS             = 0x00000004,
220                 LSA_TRUSTED_QUERY_POSIX                 = 0x00000008,
221                 LSA_TRUSTED_SET_POSIX                   = 0x00000010,
222                 LSA_TRUSTED_SET_AUTH                    = 0x00000020,
223                 LSA_TRUSTED_QUERY_AUTH                  = 0x00000040
224         } lsa_TrustedAccessMask;
225
226         /* notice the screwup with the system_name - thats why MS created
227            OpenPolicy2 */
228         [public] NTSTATUS lsa_OpenPolicy (
229                 [in,unique]       uint16 *system_name,
230                 [in]   lsa_ObjectAttribute *attr,
231                 [in]   lsa_PolicyAccessMask access_mask,
232                 [out]  policy_handle *handle
233                 );
234
235
236
237         /******************/
238         /* Function: 0x07 */
239
240         typedef struct {
241                 uint32 percent_full;
242                 uint32 maximum_log_size;
243                 hyper  retention_time;
244                 uint8  shutdown_in_progress;
245                 hyper  time_to_shutdown;
246                 uint32 next_audit_record;
247         } lsa_AuditLogInfo;
248
249         typedef [v1_enum] enum {
250                 LSA_AUDIT_POLICY_NONE=0,
251                 LSA_AUDIT_POLICY_SUCCESS=1,
252                 LSA_AUDIT_POLICY_FAILURE=2,
253                 LSA_AUDIT_POLICY_ALL=(LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE),
254                 LSA_AUDIT_POLICY_CLEAR=4
255         } lsa_PolicyAuditPolicy;
256
257         typedef enum {
258                 LSA_AUDIT_CATEGORY_SYSTEM = 0,
259                 LSA_AUDIT_CATEGORY_LOGON = 1,
260                 LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS = 2,
261                 LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS = 3,
262                 LSA_AUDIT_CATEGORY_PROCCESS_TRACKING = 4,
263                 LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES = 5,
264                 LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT = 6,
265                 LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS = 7,        /* only in win2k/2k3 */
266                 LSA_AUDIT_CATEGORY_ACCOUNT_LOGON = 8                    /* only in win2k/2k3 */
267         } lsa_PolicyAuditEventType;
268
269         typedef struct {
270                 uint32 auditing_mode;
271                 [size_is(count)] lsa_PolicyAuditPolicy *settings;
272                 uint32 count;
273         } lsa_AuditEventsInfo;
274
275         typedef struct {
276                 lsa_StringLarge name;
277                 dom_sid2 *sid;
278         } lsa_DomainInfo;
279
280         typedef struct {
281                 lsa_String name;
282         } lsa_PDAccountInfo;
283
284         typedef [v1_enum] enum {
285                 LSA_ROLE_BACKUP=2,
286                 LSA_ROLE_PRIMARY=3
287         } lsa_Role;
288
289         typedef struct {
290                 lsa_Role role;
291         } lsa_ServerRole;
292
293         typedef struct {
294                 lsa_String source;
295                 lsa_String account;
296         } lsa_ReplicaSourceInfo;
297
298         typedef struct {
299                 uint32 paged_pool;
300                 uint32 non_paged_pool;
301                 uint32 min_wss;
302                 uint32 max_wss;
303                 uint32 pagefile;
304                 hyper unknown;
305         } lsa_DefaultQuotaInfo;
306
307         typedef struct {
308                 hyper modified_id;
309                 NTTIME_hyper db_create_time;
310         } lsa_ModificationInfo;
311
312         typedef struct {
313                 uint8 shutdown_on_full;
314         } lsa_AuditFullSetInfo;
315
316         typedef struct {
317                 uint8 shutdown_on_full;
318                 uint8 log_is_full;
319         } lsa_AuditFullQueryInfo;
320
321         typedef struct {
322                 /* it's important that we use the lsa_StringLarge here,
323                  * because otherwise windows clients result with such dns hostnames
324                  * e.g. w2k3-client.samba4.samba.orgsamba4.samba.org
325                  * where it should be
326                  *      w2k3-client.samba4.samba.org
327                  */
328                 lsa_StringLarge name;
329                 lsa_StringLarge dns_domain;
330                 lsa_StringLarge dns_forest;
331                 GUID domain_guid;
332                 dom_sid2 *sid;
333         } lsa_DnsDomainInfo;
334
335         typedef enum {
336                 LSA_POLICY_INFO_AUDIT_LOG=1,
337                 LSA_POLICY_INFO_AUDIT_EVENTS=2,
338                 LSA_POLICY_INFO_DOMAIN=3,
339                 LSA_POLICY_INFO_PD=4,
340                 LSA_POLICY_INFO_ACCOUNT_DOMAIN=5,
341                 LSA_POLICY_INFO_ROLE=6,
342                 LSA_POLICY_INFO_REPLICA=7,
343                 LSA_POLICY_INFO_QUOTA=8,
344                 LSA_POLICY_INFO_MOD=9,
345                 LSA_POLICY_INFO_AUDIT_FULL_SET=10,
346                 LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
347                 LSA_POLICY_INFO_DNS=12,
348                 LSA_POLICY_INFO_DNS_INT=13,
349                 LSA_POLICY_INFO_L_ACCOUNT_DOMAIN=14
350         } lsa_PolicyInfo;
351
352         typedef [switch_type(uint16)] union {
353                 [case(LSA_POLICY_INFO_AUDIT_LOG)]        lsa_AuditLogInfo       audit_log;
354                 [case(LSA_POLICY_INFO_AUDIT_EVENTS)]     lsa_AuditEventsInfo    audit_events;
355                 [case(LSA_POLICY_INFO_DOMAIN)]           lsa_DomainInfo         domain;
356                 [case(LSA_POLICY_INFO_PD)]               lsa_PDAccountInfo      pd;
357                 [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)]   lsa_DomainInfo         account_domain;
358                 [case(LSA_POLICY_INFO_ROLE)]             lsa_ServerRole         role;
359                 [case(LSA_POLICY_INFO_REPLICA)]          lsa_ReplicaSourceInfo  replica;
360                 [case(LSA_POLICY_INFO_QUOTA)]            lsa_DefaultQuotaInfo   quota;
361                 [case(LSA_POLICY_INFO_MOD)]              lsa_ModificationInfo   mod;
362                 [case(LSA_POLICY_INFO_AUDIT_FULL_SET)]   lsa_AuditFullSetInfo   auditfullset;
363                 [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] lsa_AuditFullQueryInfo auditfullquery;
364                 [case(LSA_POLICY_INFO_DNS)]              lsa_DnsDomainInfo      dns;
365                 [case(LSA_POLICY_INFO_DNS_INT)]          lsa_DnsDomainInfo      dns;
366                 [case(LSA_POLICY_INFO_L_ACCOUNT_DOMAIN)] lsa_DomainInfo         l_account_domain;
367         } lsa_PolicyInformation;
368
369         NTSTATUS lsa_QueryInfoPolicy(
370                 [in]                            policy_handle *handle,
371                 [in]                            lsa_PolicyInfo level,
372                 [out,ref,switch_is(level)]      lsa_PolicyInformation **info
373                 );
374
375         /******************/
376         /* Function:       0x08 */
377         NTSTATUS lsa_SetInfoPolicy (
378                 [in]                            policy_handle *handle,
379                 [in]                            lsa_PolicyInfo level,
380                 [in,switch_is(level)]           lsa_PolicyInformation *info
381                 );
382
383         /******************/
384         /* Function:       0x09 */
385         [todo] NTSTATUS lsa_ClearAuditLog ();
386
387         /******************/
388         /* Function: 0x0a */
389         [public] NTSTATUS lsa_CreateAccount (
390                 [in]    policy_handle *handle,
391                 [in,ref] dom_sid2 *sid,
392                 [in]    lsa_AccountAccessMask access_mask,
393                 [out]   policy_handle *acct_handle
394                 );
395
396         /******************/
397         /* NOTE: This only returns accounts that have at least
398            one privilege set
399         */
400         /* Function: 0x0b */
401         typedef struct {
402                 dom_sid2 *sid;
403         } lsa_SidPtr;
404
405         typedef [public] struct {
406                 [range(0,1000)] uint32 num_sids;
407                 [size_is(num_sids)] lsa_SidPtr *sids;
408         } lsa_SidArray;
409
410         [public] NTSTATUS lsa_EnumAccounts(
411                 [in]         policy_handle *handle,
412                 [in,out,ref] uint32 *resume_handle,
413                 [out,ref]    lsa_SidArray *sids,
414                 [in,range(0,8192)] uint32 num_entries
415                 );
416
417         /*************************************************/
418         /* Function: 0x0c                                */
419
420         [public] NTSTATUS lsa_CreateTrustedDomain(
421                 [in]         policy_handle *policy_handle,
422                 [in]         lsa_DomainInfo *info,
423                 [in]         lsa_TrustedAccessMask access_mask,
424                 [out]        policy_handle *trustdom_handle
425                 );
426
427
428         /******************/
429         /* Function: 0x0d */
430
431         /* w2k3 treats max_size as max_domains*60       */
432         const int LSA_ENUM_TRUST_DOMAIN_MULTIPLIER = 60;
433
434         typedef struct {
435                 uint32 count;
436                 [size_is(count)] lsa_DomainInfo *domains;
437         } lsa_DomainList;
438
439         NTSTATUS lsa_EnumTrustDom(
440                 [in]               policy_handle *handle,
441                 [in,out,ref]       uint32 *resume_handle,
442                 [out,ref]          lsa_DomainList *domains,
443                 [in]               uint32 max_size
444                 );
445
446
447         /******************/
448         /* Function: 0x0e */
449         typedef [public] enum {
450                 SID_NAME_USE_NONE = 0,/* NOTUSED */
451                 SID_NAME_USER     = 1, /* user */
452                 SID_NAME_DOM_GRP  = 2, /* domain group */
453                 SID_NAME_DOMAIN   = 3, /* domain: don't know what this is */
454                 SID_NAME_ALIAS    = 4, /* local group */
455                 SID_NAME_WKN_GRP  = 5, /* well-known group */
456                 SID_NAME_DELETED  = 6, /* deleted account: needed for c2 rating */
457                 SID_NAME_INVALID  = 7, /* invalid account */
458                 SID_NAME_UNKNOWN  = 8, /* oops. */
459                 SID_NAME_COMPUTER = 9  /* machine */
460         } lsa_SidType;
461
462         typedef struct {
463                 lsa_SidType sid_type;
464                 uint32 rid;
465                 uint32 sid_index;
466         } lsa_TranslatedSid;
467
468         typedef struct {
469                 [range(0,1000)] uint32 count;
470                 [size_is(count)] lsa_TranslatedSid *sids;
471         } lsa_TransSidArray;
472
473         const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32;
474         typedef struct {
475                 [range(0,1000)] uint32 count;
476                 [size_is(count)] lsa_DomainInfo *domains;
477                 uint32 max_size;
478         } lsa_RefDomainList;
479
480         /* Level 1: Ask everywhere
481          * Level 2: Ask domain and trusted domains, no builtin and wkn
482          * Level 3: Only ask domain
483          * Level 4: W2k3ad: Only ask AD trusts
484          * Level 5: Only ask transitive forest trusts
485          * Level 6: Like 4
486          */
487
488         typedef enum {
489                 LSA_LOOKUP_NAMES_ALL = 1,
490                 LSA_LOOKUP_NAMES_DOMAINS_ONLY = 2,
491                 LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY = 3,
492                 LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY = 4,
493                 LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY = 5,
494                 LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 = 6,
495                 LSA_LOOKUP_NAMES_RODC_REFERRAL_TO_FULL_DC = 7
496         } lsa_LookupNamesLevel;
497
498         [public] NTSTATUS lsa_LookupNames (
499                 [in]         policy_handle *handle,
500                 [in,range(0,1000)] uint32 num_names,
501                 [in,size_is(num_names)]  lsa_String names[],
502                 [out,ref]    lsa_RefDomainList **domains,
503                 [in,out,ref] lsa_TransSidArray *sids,
504                 [in]         lsa_LookupNamesLevel level,
505                 [in,out,ref] uint32 *count
506                 );
507
508
509         /******************/
510         /* Function: 0x0f */
511
512         typedef struct {
513                 lsa_SidType sid_type;
514                 lsa_String name;
515                 uint32 sid_index;
516         } lsa_TranslatedName;
517
518         typedef struct {
519                 [range(0,1000)] uint32 count;
520                 [size_is(count)] lsa_TranslatedName *names;
521         } lsa_TransNameArray;
522
523         [public] NTSTATUS lsa_LookupSids(
524                 [in]         policy_handle *handle,
525                 [in,ref]     lsa_SidArray *sids,
526                 [out,ref]    lsa_RefDomainList **domains,
527                 [in,out,ref] lsa_TransNameArray *names,
528                 [in]         lsa_LookupNamesLevel level,
529                 [in,out,ref] uint32 *count
530                 );
531
532
533         /* Function:        0x10 */
534         [public] NTSTATUS lsa_CreateSecret(
535                 [in]         policy_handle *handle,
536                 [in]         lsa_String       name,
537                 [in]         lsa_SecretAccessMask access_mask,
538                 [out]        policy_handle *sec_handle
539                 );
540
541
542         /*****************************************/
543         /* Function:     0x11                    */
544         NTSTATUS lsa_OpenAccount(
545                 [in]         policy_handle *handle,
546                 [in,ref]     dom_sid2 *sid,
547                 [in]         lsa_AccountAccessMask access_mask,
548                 [out]        policy_handle *acct_handle
549                 );
550
551
552         /****************************************/
553         /* Function:    0x12                    */
554
555         typedef struct {
556                 lsa_LUID luid;
557                 uint32 attribute;
558         } lsa_LUIDAttribute;
559
560         typedef struct {
561                 [range(0,1000)] uint32 count;
562                 uint32 unknown;
563                 [size_is(count)] lsa_LUIDAttribute set[*];
564         } lsa_PrivilegeSet;
565
566         NTSTATUS lsa_EnumPrivsAccount(
567                 [in]         policy_handle *handle,
568                 [out,ref] lsa_PrivilegeSet **privs
569                 );
570
571
572         /****************************************/
573         /* Function:            0x13 */
574         NTSTATUS lsa_AddPrivilegesToAccount(
575                 [in]         policy_handle *handle,
576                 [in,ref]     lsa_PrivilegeSet *privs
577                 );
578
579
580         /****************************************/
581         /* Function:         0x14 */
582         NTSTATUS lsa_RemovePrivilegesFromAccount(
583                 [in]         policy_handle *handle,
584                 [in]         uint8 remove_all,
585                 [in,unique]  lsa_PrivilegeSet *privs
586                 );
587
588         /* Function:           0x15 */
589         [todo] NTSTATUS lsa_GetQuotasForAccount();
590
591         /* Function:           0x16 */
592         [todo] NTSTATUS lsa_SetQuotasForAccount();
593
594         typedef [bitmap32bit] bitmap {
595                 LSA_POLICY_MODE_INTERACTIVE             = 0x00000001,
596                 LSA_POLICY_MODE_NETWORK                 = 0x00000002,
597                 LSA_POLICY_MODE_BATCH                   = 0x00000004,
598                 LSA_POLICY_MODE_SERVICE                 = 0x00000010,
599                 LSA_POLICY_MODE_PROXY                   = 0x00000020,
600                 LSA_POLICY_MODE_DENY_INTERACTIVE        = 0x00000040,
601                 LSA_POLICY_MODE_DENY_NETWORK            = 0x00000080,
602                 LSA_POLICY_MODE_DENY_BATCH              = 0x00000100,
603                 LSA_POLICY_MODE_DENY_SERVICE            = 0x00000200,
604                 LSA_POLICY_MODE_REMOTE_INTERACTIVE      = 0x00000400,
605                 LSA_POLICY_MODE_DENY_REMOTE_INTERACTIVE = 0x00000800,
606                 LSA_POLICY_MODE_ALL                     = 0x00000FF7,
607                 LSA_POLICY_MODE_ALL_NT4                 = 0x00000037
608         } lsa_SystemAccessModeFlags;
609
610         /* Function:    0x17 */
611         NTSTATUS lsa_GetSystemAccessAccount(
612                 [in]      policy_handle *handle,
613                 [out,ref] lsa_AccountAccessMask *access_mask
614                 );
615
616         /* Function:    0x18 */
617         NTSTATUS lsa_SetSystemAccessAccount(
618                 [in] policy_handle *handle,
619                 [in] lsa_AccountAccessMask access_mask
620                 );
621
622         /* Function:        0x19 */
623         NTSTATUS lsa_OpenTrustedDomain(
624                 [in]     policy_handle *handle,
625                 [in]     dom_sid2      *sid,
626                 [in]     lsa_TrustedAccessMask access_mask,
627                 [out]    policy_handle *trustdom_handle
628                 );
629
630         typedef [flag(NDR_PAHEX)] struct {
631                 uint32 length;
632                 uint32 size;
633                 [size_is(size),length_is(length)] uint8 *data;
634         } lsa_DATA_BUF;
635
636         typedef [flag(NDR_PAHEX)] struct {
637                 [range(0,65536)] uint32 size;
638                 [size_is(size)] uint8 *data;
639         } lsa_DATA_BUF2;
640
641         typedef enum {
642                 LSA_TRUSTED_DOMAIN_INFO_NAME                  = 1,
643                 LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS           = 2,
644                 LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET          = 3,
645                 LSA_TRUSTED_DOMAIN_INFO_PASSWORD              = 4,
646                 LSA_TRUSTED_DOMAIN_INFO_BASIC                 = 5,
647                 LSA_TRUSTED_DOMAIN_INFO_INFO_EX               = 6,
648                 LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO             = 7,
649                 LSA_TRUSTED_DOMAIN_INFO_FULL_INFO             = 8,
650                 LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL    = 9,
651                 LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL    = 10,
652                 LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL     = 11,
653                 LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL  = 12,
654                 LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES = 13
655         } lsa_TrustDomInfoEnum;
656
657         typedef [public,bitmap32bit] bitmap {
658                 LSA_TRUST_DIRECTION_INBOUND  = 0x00000001,
659                 LSA_TRUST_DIRECTION_OUTBOUND = 0x00000002
660         } lsa_TrustDirection;
661
662         typedef [v1_enum] enum {
663                 LSA_TRUST_TYPE_DOWNLEVEL  = 0x00000001,
664                 LSA_TRUST_TYPE_UPLEVEL    = 0x00000002,
665                 LSA_TRUST_TYPE_MIT        = 0x00000003
666         } lsa_TrustType;
667
668         typedef [public,bitmap32bit] bitmap {
669                 LSA_TRUST_ATTRIBUTE_NON_TRANSITIVE      = 0x00000001,
670                 LSA_TRUST_ATTRIBUTE_UPLEVEL_ONLY        = 0x00000002,
671                 LSA_TRUST_ATTRIBUTE_QUARANTINED_DOMAIN  = 0x00000004,
672                 LSA_TRUST_ATTRIBUTE_FOREST_TRANSITIVE   = 0x00000008,
673                 LSA_TRUST_ATTRIBUTE_CROSS_ORGANIZATION  = 0x00000010,
674                 LSA_TRUST_ATTRIBUTE_WITHIN_FOREST       = 0x00000020,
675                 LSA_TRUST_ATTRIBUTE_TREAT_AS_EXTERNAL   = 0x00000040,
676                 LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION = 0x00000080
677         } lsa_TrustAttributes;
678
679         typedef struct {
680                 lsa_StringLarge  netbios_name;
681         } lsa_TrustDomainInfoName;
682
683
684         typedef struct {
685                 uint32 entries;
686                 [size_is(entries)] lsa_StringLarge  *netbios_names;
687         } lsa_TrustDomainInfoControllers;
688
689         typedef struct {
690                 uint32         posix_offset;
691         } lsa_TrustDomainInfoPosixOffset;
692
693         typedef struct {
694                 lsa_DATA_BUF  *password;
695                 lsa_DATA_BUF  *old_password;
696         } lsa_TrustDomainInfoPassword;
697
698         typedef struct {
699                 lsa_String     netbios_name;
700                 dom_sid2      *sid;
701         } lsa_TrustDomainInfoBasic;
702
703         typedef struct {
704                 lsa_StringLarge     domain_name;
705                 lsa_StringLarge     netbios_name;
706                 dom_sid2           *sid;
707                 lsa_TrustDirection  trust_direction;
708                 lsa_TrustType       trust_type;
709                 lsa_TrustAttributes trust_attributes;
710         } lsa_TrustDomainInfoInfoEx;
711
712         typedef [public,v1_enum] enum {
713                 TRUST_AUTH_TYPE_NONE = 0,
714                 TRUST_AUTH_TYPE_NT4OWF = 1,
715                 TRUST_AUTH_TYPE_CLEAR = 2,
716                 TRUST_AUTH_TYPE_VERSION = 3
717         } lsa_TrustAuthType;
718
719         typedef struct {
720                 NTTIME_hyper   last_update_time;
721                 lsa_TrustAuthType AuthType;
722                 lsa_DATA_BUF2  data;
723         } lsa_TrustDomainInfoBuffer;
724
725         typedef struct {
726                 uint32 incoming_count;
727                 lsa_TrustDomainInfoBuffer *incoming_current_auth_info;
728                 lsa_TrustDomainInfoBuffer *incoming_previous_auth_info;
729                 uint32 outgoing_count;
730                 lsa_TrustDomainInfoBuffer *outgoing_current_auth_info;
731                 lsa_TrustDomainInfoBuffer *outgoing_previous_auth_info;
732         } lsa_TrustDomainInfoAuthInfo;
733
734         typedef struct {
735                 lsa_TrustDomainInfoInfoEx      info_ex;
736                 lsa_TrustDomainInfoPosixOffset posix_offset;
737                 lsa_TrustDomainInfoAuthInfo    auth_info;
738         } lsa_TrustDomainInfoFullInfo;
739
740         typedef struct {
741                 lsa_DATA_BUF2                          auth_blob;
742         } lsa_TrustDomainInfoAuthInfoInternal;
743
744         typedef struct {
745                 lsa_TrustDomainInfoInfoEx              info_ex;
746                 lsa_TrustDomainInfoPosixOffset         posix_offset;
747                 lsa_TrustDomainInfoAuthInfoInternal    auth_info;
748         } lsa_TrustDomainInfoFullInfoInternal;
749
750         typedef struct {
751                 lsa_TrustDomainInfoInfoEx      info_ex;
752                 uint32 forest_trust_length;
753                 [size_is(forest_trust_length)] uint8 *forest_trust_data;
754         } lsa_TrustDomainInfoInfoEx2Internal;
755
756         typedef struct {
757                 lsa_TrustDomainInfoInfoEx2Internal     info;
758                 lsa_TrustDomainInfoPosixOffset posix_offset;
759                 lsa_TrustDomainInfoAuthInfo    auth_info;
760         } lsa_TrustDomainInfoFullInfo2Internal;
761
762         typedef struct {
763                 kerb_EncTypes enc_types;
764         } lsa_TrustDomainInfoSupportedEncTypes;
765
766         typedef [switch_type(lsa_TrustDomInfoEnum)] union {
767                 [case(LSA_TRUSTED_DOMAIN_INFO_NAME)]
768                         lsa_TrustDomainInfoName              name;
769                 [case(LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS)]
770                         lsa_TrustDomainInfoControllers   controllers;
771                 [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)]
772                         lsa_TrustDomainInfoPosixOffset       posix_offset;
773                 [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)]
774                         lsa_TrustDomainInfoPassword          password;
775                 [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)]
776                         lsa_TrustDomainInfoBasic             info_basic;
777                 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)]
778                         lsa_TrustDomainInfoInfoEx            info_ex;
779                 [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)]
780                         lsa_TrustDomainInfoAuthInfo          auth_info;
781                 [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)]
782                         lsa_TrustDomainInfoFullInfo          full_info;
783                 [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO_INTERNAL)]
784                         lsa_TrustDomainInfoAuthInfoInternal  auth_info_internal;
785                 [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_INTERNAL)]
786                         lsa_TrustDomainInfoFullInfoInternal  full_info_internal;
787                 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX2_INTERNAL)]
788                         lsa_TrustDomainInfoInfoEx2Internal   info_ex2_internal;
789                 [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL)]
790                         lsa_TrustDomainInfoFullInfo2Internal     full_info2_internal;
791                 [case(LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES)]
792                         lsa_TrustDomainInfoSupportedEncTypes enc_types;
793         } lsa_TrustedDomainInfo;
794
795         /* Function:       0x1a */
796         NTSTATUS lsa_QueryTrustedDomainInfo(
797                 [in]     policy_handle                   *trustdom_handle,
798                 [in]     lsa_TrustDomInfoEnum             level,
799                 [out,switch_is(level),ref] lsa_TrustedDomainInfo **info
800                 );
801
802         /* Function:     0x1b */
803         NTSTATUS lsa_SetInformationTrustedDomain(
804                 [in]                  policy_handle         *trustdom_handle,
805                 [in]                  lsa_TrustDomInfoEnum   level,
806                 [in,switch_is(level)] lsa_TrustedDomainInfo *info
807                 );
808
809         /* Function:          0x1c */
810         [public] NTSTATUS lsa_OpenSecret(
811                 [in]     policy_handle    *handle,
812                 [in]         lsa_String        name,
813                 [in]     lsa_SecretAccessMask access_mask,
814                 [out]    policy_handle    *sec_handle
815                 );
816
817         /* Function:           0x1d */
818
819         [public] NTSTATUS lsa_SetSecret(
820                 [in]     policy_handle    *sec_handle,
821                 [in,unique]         lsa_DATA_BUF     *new_val,
822                 [in,unique]         lsa_DATA_BUF     *old_val
823                 );
824
825         typedef struct {
826                 lsa_DATA_BUF *buf;
827         } lsa_DATA_BUF_PTR;
828
829         /* Function:         0x1e */
830         [public] NTSTATUS lsa_QuerySecret (
831                 [in]     policy_handle     *sec_handle,
832                 [in,out,unique]     lsa_DATA_BUF_PTR  *new_val,
833                 [in,out,unique]     NTTIME_hyper      *new_mtime,
834                 [in,out,unique]     lsa_DATA_BUF_PTR  *old_val,
835                 [in,out,unique]     NTTIME_hyper      *old_mtime
836                 );
837
838         /* Function:     0x1f */
839         NTSTATUS lsa_LookupPrivValue(
840                 [in]     policy_handle *handle,
841                 [in,ref] lsa_String *name,
842                 [out,ref] lsa_LUID *luid
843                 );
844
845
846         /* Function:      0x20 */
847         NTSTATUS lsa_LookupPrivName(
848                 [in]     policy_handle *handle,
849                 [in,ref] lsa_LUID *luid,
850                 [out,ref] lsa_StringLarge **name
851                 );
852
853
854         /*******************/
855         /* Function:  0x21 */
856         NTSTATUS lsa_LookupPrivDisplayName(
857                 [in] policy_handle *handle,
858                 [in,ref] lsa_String *name,
859                 [in] uint16 language_id,
860                 [in] uint16 language_id_sys,
861                 [out,ref] lsa_StringLarge **disp_name,
862                 /* see http://www.microsoft.com/globaldev/nlsweb/ for
863                    language definitions */
864                 [out,ref] uint16 *returned_language_id
865                 );
866
867         /*******************/
868         /* Function:  0x22 */
869         NTSTATUS lsa_DeleteObject (
870                 [in,out]     policy_handle *handle
871                 );
872
873         /*******************/
874         /* Function:      0x23 */
875         NTSTATUS lsa_EnumAccountsWithUserRight (
876                 [in]     policy_handle *handle,
877                 [in,unique]         lsa_String *name,
878                 [out]    lsa_SidArray *sids
879                 );
880
881         /* Function:      0x24 */
882         typedef struct {
883                 [string,charset(UTF16)] uint16 *name;
884         } lsa_RightAttribute;
885
886         typedef struct {
887                 [range(0,256)] uint32 count;
888                 [size_is(count)] lsa_StringLarge *names;
889         } lsa_RightSet;
890
891         NTSTATUS lsa_EnumAccountRights (
892                 [in]     policy_handle *handle,
893                 [in,ref] dom_sid2 *sid,
894                 [out,ref] lsa_RightSet *rights
895                 );
896
897
898         /**********************/
899         /* Function:       0x25 */
900         NTSTATUS lsa_AddAccountRights (
901                 [in]     policy_handle *handle,
902                 [in,ref] dom_sid2 *sid,
903                 [in,ref] lsa_RightSet *rights
904                 );
905
906         /**********************/
907         /* Function:       0x26 */
908         NTSTATUS lsa_RemoveAccountRights (
909                 [in]     policy_handle *handle,
910                 [in,ref] dom_sid2 *sid,
911                 [in]     uint8 remove_all,
912                 [in,ref] lsa_RightSet *rights
913                 );
914
915         /* Function:   0x27 */
916         NTSTATUS lsa_QueryTrustedDomainInfoBySid(
917                 [in]               policy_handle         *handle,
918                 [in,ref]           dom_sid2              *dom_sid,
919                 [in]               lsa_TrustDomInfoEnum  level,
920                 [out,switch_is(level),ref] lsa_TrustedDomainInfo **info
921         );
922
923         /* Function:     0x28 */
924         NTSTATUS lsa_SetTrustedDomainInfo(
925                 [in]               policy_handle         *handle,
926                 [in]               dom_sid2              *dom_sid,
927                 [in]               lsa_TrustDomInfoEnum  level,
928                 [in,switch_is(level)] lsa_TrustedDomainInfo *info
929         );
930
931         /* Function:      0x29 */
932         NTSTATUS lsa_DeleteTrustedDomain(
933                 [in]               policy_handle         *handle,
934                 [in]               dom_sid2              *dom_sid
935         );
936
937         /* Function:       0x2a */
938         NTSTATUS lsa_StorePrivateData(
939                 [in]            policy_handle   *handle,
940                 [in,ref]        lsa_String      *name,
941                 [in,unique]     lsa_DATA_BUF    *val
942         );
943
944         /* Function:        0x2b */
945         NTSTATUS lsa_RetrievePrivateData(
946                 [in]            policy_handle   *handle,
947                 [in,ref]        lsa_String      *name,
948                 [in,out,ref]    lsa_DATA_BUF    **val
949         );
950
951         /**********************/
952         /* Function:     0x2c */
953         [public] NTSTATUS lsa_OpenPolicy2 (
954                 [in,unique]      [string,charset(UTF16)] uint16 *system_name,
955                 [in]  lsa_ObjectAttribute *attr,
956                 [in]  lsa_PolicyAccessMask access_mask,
957                 [out] policy_handle *handle
958                 );
959
960         /**********************/
961         /* Function:     0x2d */
962         NTSTATUS lsa_GetUserName(
963                 [in,unique] [string,charset(UTF16)] uint16 *system_name,
964                 [in,out,ref] lsa_String **account_name,
965                 [in,out,unique] lsa_String **authority_name
966                 );
967
968         /**********************/
969         /* Function:          0x2e */
970
971         NTSTATUS lsa_QueryInfoPolicy2(
972                 [in]                         policy_handle *handle,
973                 [in]                         lsa_PolicyInfo level,
974                 [out,ref,switch_is(level)]   lsa_PolicyInformation **info
975                 );
976
977         /* Function 0x2f */
978         NTSTATUS lsa_SetInfoPolicy2(
979                 [in]                            policy_handle *handle,
980                 [in]                            lsa_PolicyInfo level,
981                 [in,switch_is(level)]           lsa_PolicyInformation *info
982                 );
983
984         /**********************/
985         /* Function 0x30 */
986         NTSTATUS lsa_QueryTrustedDomainInfoByName(
987                 [in]                   policy_handle          *handle,
988                 [in,ref]               lsa_String             *trusted_domain,
989                 [in]                   lsa_TrustDomInfoEnum   level,
990                 [out,ref,switch_is(level)] lsa_TrustedDomainInfo **info
991                 );
992
993         /**********************/
994         /* Function 0x31 */
995         NTSTATUS lsa_SetTrustedDomainInfoByName(
996                 [in]                   policy_handle         *handle,
997                 [in]                   lsa_String             trusted_domain,
998                 [in]                   lsa_TrustDomInfoEnum   level,
999                 [in,unique,switch_is(level)] lsa_TrustedDomainInfo *info
1000                 );
1001
1002         /* Function 0x32 */
1003
1004         /* w2k3 treats max_size as max_domains*82       */
1005         const int LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER = 82;
1006
1007         typedef struct {
1008                 uint32 count;
1009                 [size_is(count)] lsa_TrustDomainInfoInfoEx *domains;
1010         } lsa_DomainListEx;
1011
1012         NTSTATUS lsa_EnumTrustedDomainsEx (
1013                 [in]               policy_handle *handle,
1014                 [in,out]           uint32 *resume_handle,
1015                 [out]              lsa_DomainListEx *domains,
1016                 [in]               uint32 max_size
1017                 );
1018
1019         /* Function 0x33 */
1020         NTSTATUS lsa_CreateTrustedDomainEx(
1021                 [in]  policy_handle               *policy_handle,
1022                 [in]  lsa_TrustDomainInfoInfoEx   *info,
1023                 [in]  lsa_TrustDomainInfoAuthInfoInternal *auth_info,
1024                 [in]  uint32 access_mask,
1025                 [out] policy_handle               *trustdom_handle
1026                 );
1027
1028
1029         /* Function 0x34 */
1030         NTSTATUS lsa_CloseTrustedDomainEx(
1031                 [in,out]                   policy_handle         *handle
1032         );
1033
1034         /* Function 0x35 */
1035
1036         /* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000
1037            for unknown6 - gd */
1038         typedef struct {
1039                 uint32 enforce_restrictions;
1040                 hyper service_tkt_lifetime;
1041                 hyper user_tkt_lifetime;
1042                 hyper user_tkt_renewaltime;
1043                 hyper clock_skew;
1044                 hyper unknown6;
1045         } lsa_DomainInfoKerberos;
1046
1047         typedef struct {
1048                 uint32 blob_size;
1049                 [size_is(blob_size)] uint8 *efs_blob;
1050         } lsa_DomainInfoEfs;
1051
1052         typedef enum {
1053                 LSA_DOMAIN_INFO_POLICY_EFS=2,
1054                 LSA_DOMAIN_INFO_POLICY_KERBEROS=3
1055         } lsa_DomainInfoEnum;
1056
1057         typedef [switch_type(uint16)] union {
1058                 [case(LSA_DOMAIN_INFO_POLICY_EFS)]      lsa_DomainInfoEfs       efs_info;
1059                 [case(LSA_DOMAIN_INFO_POLICY_KERBEROS)] lsa_DomainInfoKerberos  kerberos_info;
1060         } lsa_DomainInformationPolicy;
1061
1062         NTSTATUS lsa_QueryDomainInformationPolicy(
1063                 [in]            policy_handle *handle,
1064                 [in]            uint16 level,
1065                 [out,ref,switch_is(level)]      lsa_DomainInformationPolicy **info
1066                 );
1067
1068         /* Function 0x36 */
1069         NTSTATUS lsa_SetDomainInformationPolicy(
1070                 [in]            policy_handle *handle,
1071                 [in]                    uint16 level,
1072                 [in,unique,switch_is(level)]    lsa_DomainInformationPolicy *info
1073                 );
1074
1075         /**********************/
1076         /* Function 0x37 */
1077         NTSTATUS lsa_OpenTrustedDomainByName(
1078                 [in]     policy_handle *handle,
1079                 [in]         lsa_String     name,
1080                 [in]         uint32         access_mask,
1081                 [out]    policy_handle *trustdom_handle
1082                 );
1083
1084         /* Function 0x38 */
1085         [todo] NTSTATUS lsa_TestCall();
1086
1087         /**********************/
1088         /* Function 0x39 */
1089
1090         typedef struct {
1091                 lsa_SidType sid_type;
1092                 lsa_String name;
1093                 uint32 sid_index;
1094                 uint32 unknown;
1095         } lsa_TranslatedName2;
1096
1097         typedef struct {
1098                 [range(0,1000)] uint32 count;
1099                 [size_is(count)] lsa_TranslatedName2 *names;
1100         } lsa_TransNameArray2;
1101
1102         typedef [v1_enum] enum {
1103                 LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES         = 0x00000000,
1104                 LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES_LOCAL   = 0x80000000
1105         } lsa_LookupOptions;
1106
1107         typedef [v1_enum] enum {
1108                 LSA_CLIENT_REVISION_1   = 0x00000001,
1109                 LSA_CLIENT_REVISION_2   = 0x00000002
1110         } lsa_ClientRevision;
1111
1112         [public] NTSTATUS lsa_LookupSids2(
1113                 [in]     policy_handle *handle,
1114                 [in,ref] lsa_SidArray *sids,
1115                 [out,ref]    lsa_RefDomainList **domains,
1116                 [in,out,ref] lsa_TransNameArray2 *names,
1117                 [in]         lsa_LookupNamesLevel level,
1118                 [in,out,ref] uint32 *count,
1119                 [in]         lsa_LookupOptions lookup_options,
1120                 [in]         lsa_ClientRevision client_revision
1121                 );
1122
1123         /**********************/
1124         /* Function 0x3a */
1125
1126         typedef struct {
1127                 lsa_SidType sid_type;
1128                 uint32 rid;
1129                 uint32 sid_index;
1130                 uint32 unknown;
1131         } lsa_TranslatedSid2;
1132
1133         typedef struct {
1134                 [range(0,1000)] uint32 count;
1135                 [size_is(count)] lsa_TranslatedSid2 *sids;
1136         } lsa_TransSidArray2;
1137
1138         [public] NTSTATUS lsa_LookupNames2 (
1139                 [in]     policy_handle *handle,
1140                 [in,range(0,1000)] uint32 num_names,
1141                 [in,size_is(num_names)]  lsa_String names[],
1142                 [out,ref]    lsa_RefDomainList **domains,
1143                 [in,out,ref] lsa_TransSidArray2 *sids,
1144                 [in]         lsa_LookupNamesLevel level,
1145                 [in,out,ref] uint32 *count,
1146                 [in]         lsa_LookupOptions lookup_options,
1147                 [in]         lsa_ClientRevision client_revision
1148                 );
1149
1150         /* Function 0x3b */
1151         NTSTATUS lsa_CreateTrustedDomainEx2(
1152                 [in]  policy_handle               *policy_handle,
1153                 [in]  lsa_TrustDomainInfoInfoEx   *info,
1154                 [in]  lsa_TrustDomainInfoAuthInfoInternal *auth_info,
1155                 [in]  uint32                       access_mask,
1156                 [out] policy_handle               *trustdom_handle
1157                 );
1158
1159         /* Function 0x3c */
1160         [todo] NTSTATUS lsa_CREDRWRITE();
1161
1162         /* Function 0x3d */
1163         [todo] NTSTATUS lsa_CREDRREAD();
1164
1165         /* Function 0x3e */
1166         [todo] NTSTATUS lsa_CREDRENUMERATE();
1167
1168         /* Function 0x3f */
1169         [todo] NTSTATUS lsa_CREDRWRITEDOMAINCREDENTIALS();
1170
1171         /* Function 0x40 */
1172         [todo] NTSTATUS lsa_CREDRREADDOMAINCREDENTIALS();
1173
1174         /* Function 0x41 */
1175         [todo] NTSTATUS lsa_CREDRDELETE();
1176
1177         /* Function 0x42 */
1178         [todo] NTSTATUS lsa_CREDRGETTARGETINFO();
1179
1180         /* Function 0x43 */
1181         [todo] NTSTATUS lsa_CREDRPROFILELOADED();
1182
1183         /**********************/
1184         /* Function 0x44 */
1185         typedef struct {
1186                 lsa_SidType sid_type;
1187                 dom_sid2 *sid;
1188                 uint32 sid_index;
1189                 uint32 flags;
1190         } lsa_TranslatedSid3;
1191
1192         typedef struct {
1193                 [range(0,1000)] uint32 count;
1194                 [size_is(count)] lsa_TranslatedSid3 *sids;
1195         } lsa_TransSidArray3;
1196
1197         [public] NTSTATUS lsa_LookupNames3 (
1198                 [in]     policy_handle *handle,
1199                 [in,range(0,1000)] uint32 num_names,
1200                 [in,size_is(num_names)]  lsa_String names[],
1201                 [out,ref]    lsa_RefDomainList **domains,
1202                 [in,out,ref] lsa_TransSidArray3 *sids,
1203                 [in]         lsa_LookupNamesLevel level,
1204                 [in,out,ref] uint32 *count,
1205                 [in]         lsa_LookupOptions lookup_options,
1206                 [in]         lsa_ClientRevision client_revision
1207                 );
1208
1209         /* Function 0x45 */
1210         [todo] NTSTATUS lsa_CREDRGETSESSIONTYPES();
1211
1212         /* Function 0x46 */
1213         [todo] NTSTATUS lsa_LSARREGISTERAUDITEVENT();
1214
1215         /* Function 0x47 */
1216         [todo] NTSTATUS lsa_LSARGENAUDITEVENT();
1217
1218         /* Function 0x48 */
1219         [todo] NTSTATUS lsa_LSARUNREGISTERAUDITEVENT();
1220
1221         /* Function 0x49 */
1222         typedef struct {
1223                 [range(0,131072)] uint32 length;
1224                 [size_is(length)] uint8 *data;
1225         } lsa_ForestTrustBinaryData;
1226
1227         typedef struct {
1228                 dom_sid2 *domain_sid;
1229                 lsa_StringLarge dns_domain_name;
1230                 lsa_StringLarge netbios_domain_name;
1231         } lsa_ForestTrustDomainInfo;
1232
1233         typedef [switch_type(uint32)] union {
1234                 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] lsa_String top_level_name;
1235                 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] lsa_StringLarge top_level_name_ex;
1236                 [case(LSA_FOREST_TRUST_DOMAIN_INFO)] lsa_ForestTrustDomainInfo domain_info;
1237                 [default] lsa_ForestTrustBinaryData data;
1238         } lsa_ForestTrustData;
1239
1240         typedef [v1_enum] enum {
1241                 LSA_FOREST_TRUST_TOP_LEVEL_NAME = 0,
1242                 LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX = 1,
1243                 LSA_FOREST_TRUST_DOMAIN_INFO = 2,
1244                 LSA_FOREST_TRUST_RECORD_TYPE_LAST = 3
1245         } lsa_ForestTrustRecordType;
1246
1247         typedef struct {
1248                 uint32 flags;
1249                 lsa_ForestTrustRecordType level;
1250                 hyper unknown;
1251                 [switch_is(level)] lsa_ForestTrustData forest_trust_data;
1252         } lsa_ForestTrustRecord;
1253
1254         typedef [public] struct {
1255                 [range(0,4000)] uint32 count;
1256                 [size_is(count)] lsa_ForestTrustRecord **entries;
1257         } lsa_ForestTrustInformation;
1258
1259         NTSTATUS lsa_lsaRQueryForestTrustInformation(
1260                 [in] policy_handle *handle,
1261                 [in,ref] lsa_String *trusted_domain_name,
1262                 [in] uint16 unknown, /* level ? */
1263                 [out,ref] lsa_ForestTrustInformation **forest_trust_info
1264                 );
1265
1266         /* Function 0x4a */
1267         [todo] NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION();
1268
1269         /* Function 0x4b */
1270         [todo] NTSTATUS lsa_CREDRRENAME();
1271
1272         /*****************/
1273         /* Function 0x4c */
1274
1275         [public] NTSTATUS lsa_LookupSids3(
1276                 [in,ref]     lsa_SidArray *sids,
1277                 [out,ref]    lsa_RefDomainList **domains,
1278                 [in,out,ref] lsa_TransNameArray2 *names,
1279                 [in]         lsa_LookupNamesLevel level,
1280                 [in,out,ref] uint32 *count,
1281                 [in]         lsa_LookupOptions lookup_options,
1282                 [in]         lsa_ClientRevision client_revision
1283                 );
1284
1285         const int LSA_CLIENT_REVISION_NO_DNS     = 0x00000001;
1286         const int LSA_CLIENT_REVISION_DNS        = 0x00000002;
1287
1288         const int LSA_LOOKUP_OPTIONS_NO_ISOLATED = 0x80000000;
1289
1290         /* Function 0x4d */
1291         NTSTATUS lsa_LookupNames4(
1292                 [in,range(0,1000)] uint32 num_names,
1293                 [in,size_is(num_names)]  lsa_String names[],
1294                 [out,ref]    lsa_RefDomainList **domains,
1295                 [in,out,ref] lsa_TransSidArray3 *sids,
1296                 [in]         lsa_LookupNamesLevel level,
1297                 [in,out,ref] uint32 *count,
1298                 [in]         lsa_LookupOptions lookup_options,
1299                 [in]         lsa_ClientRevision client_revision
1300                 );
1301
1302         /* Function 0x4e */
1303         [todo] NTSTATUS lsa_LSAROPENPOLICYSCE();
1304
1305         /* Function 0x4f */
1306         [todo] NTSTATUS lsa_LSARADTREGISTERSECURITYEVENTSOURCE();
1307
1308         /* Function 0x50 */
1309         [todo] NTSTATUS lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE();
1310
1311         /* Function 0x51 */
1312         [todo] NTSTATUS lsa_LSARADTREPORTSECURITYEVENT();
1313
1314 }