ldb_map objectClass munging: Don't hard-code 'extensibleObject'.
[samba.git] / source4 / librpc / idl / lsa.idl
1 #include "idl_types.h"
2
3 /*
4   lsa interface definition
5 */
6
7 import "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
18         typedef [public,noejs] struct {
19                 [value(2*strlen_m(string))] uint16 length;
20                 [value(2*strlen_m(string))] uint16 size;
21                 [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
22         } lsa_String;
23
24         typedef [public] struct {
25                 [value(2*strlen_m(string))] uint16 length;
26                 [value(2*(strlen_m(string)+1))] uint16 size;
27                 [charset(UTF16),size_is(size/2),length_is(length/2)] uint16 *string;
28         } lsa_StringLarge;
29
30         typedef [public] struct {
31                 uint32 count;
32                 [size_is(count)] lsa_String *names;
33         } lsa_Strings;
34
35         typedef [public] struct {
36                 [value(strlen_m(string))] uint16 length;
37                 [value(strlen_m(string))] uint16 size;
38                 ascstr_noterm *string;
39         } lsa_AsciiString;
40
41         /******************/
42         /* Function: 0x00 */
43         NTSTATUS lsa_Close (
44                 [in,out]     policy_handle *handle
45                 );
46         
47
48         /******************/
49         /* Function: 0x01 */
50         [public] NTSTATUS lsa_Delete (
51                 [in]     policy_handle *handle
52                 );
53
54
55         /******************/
56         /* Function: 0x02 */
57         typedef struct {
58                 uint32 low;
59                 uint32 high;
60         } lsa_LUID;
61         
62         typedef struct {
63                 lsa_StringLarge name;
64                 lsa_LUID luid;
65         } lsa_PrivEntry;
66
67         typedef struct {
68                 uint32 count;
69                 [size_is(count)] lsa_PrivEntry *privs;
70         } lsa_PrivArray;
71
72         [public] NTSTATUS lsa_EnumPrivs (
73                 [in]     policy_handle *handle,
74                 [in,out] uint32 *resume_handle,
75                 [in]         uint32 max_count,
76                 [out]    lsa_PrivArray *privs
77                 );
78
79         /******************/
80         /* Function: 0x03 */
81
82         NTSTATUS lsa_QuerySecurity (
83                 [in]     policy_handle *handle,
84                 [in]         security_secinfo sec_info,
85                 [out,unique]        sec_desc_buf *sdbuf
86                 );
87
88
89         /******************/
90         /* Function: 0x04 */
91         NTSTATUS lsa_SetSecObj ();
92
93
94         /******************/
95         /* Function: 0x05 */
96         NTSTATUS lsa_ChangePassword ();
97
98
99         /******************/
100         /* Function: 0x06 */
101         typedef struct {
102                 uint32  len; /* ignored */
103                 uint16  impersonation_level;
104                 uint8   context_mode;
105                 uint8   effective_only;
106         } lsa_QosInfo;
107         
108         typedef struct {
109                 uint32 len; /* ignored */
110                 uint8 *root_dir;
111                 [string,charset(UTF16)] uint16 *object_name;
112                 uint32 attributes;
113                 security_descriptor *sec_desc;
114                 lsa_QosInfo *sec_qos;
115         } lsa_ObjectAttribute;
116
117         /* notice the screwup with the system_name - thats why MS created
118            OpenPolicy2 */
119         [public] NTSTATUS lsa_OpenPolicy (
120                 [in,unique]       uint16 *system_name,
121                 [in]   lsa_ObjectAttribute *attr,
122                 [in]       uint32 access_mask,
123                 [out]  policy_handle *handle
124                 );
125         
126
127
128         /******************/
129         /* Function: 0x07 */
130
131         typedef struct {
132                 uint32 percent_full;
133                 uint32 log_size;
134                 NTTIME retention_time;
135                 uint8  shutdown_in_progress;
136                 NTTIME time_to_shutdown;
137                 uint32 next_audit_record;
138                 uint32 unknown;
139         } lsa_AuditLogInfo;
140
141         typedef struct {
142                 uint32 auditing_mode;
143                 [size_is(count)] uint32 *settings;
144                 uint32 count;
145         } lsa_AuditEventsInfo;
146
147         typedef struct {
148                 lsa_StringLarge name;
149                 dom_sid2 *sid;
150         } lsa_DomainInfo;
151
152         typedef struct {
153                 lsa_String name;
154         } lsa_PDAccountInfo;
155
156         typedef struct {
157                 uint16 unknown; /* an midl padding bug? */
158                 uint16 role;
159         } lsa_ServerRole;
160
161         typedef struct {
162                 lsa_String source;
163                 lsa_String account;
164         } lsa_ReplicaSourceInfo;
165
166         typedef struct {
167                 uint32 paged_pool;
168                 uint32 non_paged_pool;
169                 uint32 min_wss;
170                 uint32 max_wss;
171                 uint32 pagefile;
172                 hyper unknown;
173         } lsa_DefaultQuotaInfo;
174
175         typedef struct {
176                 hyper modified_id;
177                 NTTIME db_create_time;
178         } lsa_ModificationInfo;
179
180         typedef struct {
181                 uint8 shutdown_on_full;
182         } lsa_AuditFullSetInfo;
183
184         typedef struct {
185                 uint16 unknown; /* an midl padding bug? */
186                 uint8 shutdown_on_full;
187                 uint8 log_is_full;
188         } lsa_AuditFullQueryInfo;
189
190         typedef struct {
191                 /* it's important that we use the lsa_StringLarge here,
192                  * because otherwise windows clients result with such dns hostnames
193                  * e.g. w2k3-client.samba4.samba.orgsamba4.samba.org
194                  * where it should be
195                  *      w2k3-client.samba4.samba.org
196                  */
197                 lsa_StringLarge name;
198                 lsa_StringLarge dns_domain;
199                 lsa_StringLarge dns_forest;
200                 GUID domain_guid;
201                 dom_sid2 *sid;
202         } lsa_DnsDomainInfo;
203
204         typedef enum {
205                 LSA_POLICY_INFO_AUDIT_LOG=1,
206                 LSA_POLICY_INFO_AUDIT_EVENTS=2,
207                 LSA_POLICY_INFO_DOMAIN=3,
208                 LSA_POLICY_INFO_PD=4,
209                 LSA_POLICY_INFO_ACCOUNT_DOMAIN=5,
210                 LSA_POLICY_INFO_ROLE=6,
211                 LSA_POLICY_INFO_REPLICA=7,
212                 LSA_POLICY_INFO_QUOTA=8,
213                 LSA_POLICY_INFO_DB=9,
214                 LSA_POLICY_INFO_AUDIT_FULL_SET=10,
215                 LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
216                 LSA_POLICY_INFO_DNS=12
217         } lsa_PolicyInfo;
218
219         typedef [switch_type(uint16)] union {
220                 [case(LSA_POLICY_INFO_AUDIT_LOG)]        lsa_AuditLogInfo       audit_log;
221                 [case(LSA_POLICY_INFO_AUDIT_EVENTS)]     lsa_AuditEventsInfo    audit_events;
222                 [case(LSA_POLICY_INFO_DOMAIN)]           lsa_DomainInfo         domain;
223                 [case(LSA_POLICY_INFO_PD)]               lsa_PDAccountInfo      pd;
224                 [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)]   lsa_DomainInfo         account_domain;
225                 [case(LSA_POLICY_INFO_ROLE)]             lsa_ServerRole         role;
226                 [case(LSA_POLICY_INFO_REPLICA)]          lsa_ReplicaSourceInfo  replica;
227                 [case(LSA_POLICY_INFO_QUOTA)]            lsa_DefaultQuotaInfo   quota;
228                 [case(LSA_POLICY_INFO_DB)]               lsa_ModificationInfo   db;
229                 [case(LSA_POLICY_INFO_AUDIT_FULL_SET)]   lsa_AuditFullSetInfo   auditfullset;
230                 [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] lsa_AuditFullQueryInfo auditfullquery;
231                 [case(LSA_POLICY_INFO_DNS)]              lsa_DnsDomainInfo      dns;
232         } lsa_PolicyInformation;
233
234         NTSTATUS lsa_QueryInfoPolicy (
235                 [in]                            policy_handle *handle,
236                 [in]                            lsa_PolicyInfo level,
237                 [out,unique,switch_is(level)]   lsa_PolicyInformation *info
238                 );
239
240         /******************/
241         /* Function:       0x08 */
242         NTSTATUS lsa_SetInfoPolicy (
243                 [in]                            policy_handle *handle,
244                 [in]                            lsa_PolicyInfo level,
245                 [in,switch_is(level)]           lsa_PolicyInformation *info
246                 );
247
248         /******************/
249         /* Function:       0x09 */
250         NTSTATUS lsa_ClearAuditLog ();
251
252         /******************/
253         /* Function: 0x0a */
254         [public] NTSTATUS lsa_CreateAccount (
255                 [in]    policy_handle *handle,
256                 [in]    dom_sid2 *sid,
257                 [in]    uint32 access_mask,
258                 [out]   policy_handle *acct_handle
259                 );
260
261         /******************/
262         /* NOTE: This only returns accounts that have at least
263            one privilege set 
264         */
265         /* Function: 0x0b */
266         typedef struct {
267                 dom_sid2 *sid;
268         } lsa_SidPtr;
269         
270         typedef [public] struct {
271                 [range(0,1000)] uint32 num_sids;
272                 [size_is(num_sids)] lsa_SidPtr *sids;
273         } lsa_SidArray;
274
275         [public] NTSTATUS lsa_EnumAccounts (
276                 [in]         policy_handle *handle,
277                 [in,out]     uint32 *resume_handle,
278                 [in,range(0,8192)] uint32 num_entries,
279                 [out]        lsa_SidArray *sids
280                 );
281
282
283         /*************************************************/
284         /* Function: 0x0c                                */
285
286         [public] NTSTATUS lsa_CreateTrustedDomain(
287                 [in]         policy_handle *handle,
288                 [in]         lsa_DomainInfo *info,
289                 [in]         uint32 access_mask,
290                 [out]        policy_handle *trustdom_handle
291                 );
292
293
294         /******************/
295         /* Function: 0x0d */
296
297         /* w2k3 treats max_size as max_domains*60       */
298         const int LSA_ENUM_TRUST_DOMAIN_MULTIPLIER = 60;
299
300         typedef struct {
301                 uint32 count;
302                 [size_is(count)] lsa_DomainInfo *domains;
303         } lsa_DomainList;
304
305         NTSTATUS lsa_EnumTrustDom (
306                 [in]               policy_handle *handle,
307                 [in,out]           uint32 *resume_handle,
308                 [in]               uint32 max_size,
309                 [out]              lsa_DomainList *domains
310                 );
311
312
313         /******************/
314         /* Function: 0x0e */
315         typedef enum {
316                 SID_NAME_USE_NONE = 0,/* NOTUSED */
317                 SID_NAME_USER     = 1, /* user */
318                 SID_NAME_DOM_GRP  = 2, /* domain group */
319                 SID_NAME_DOMAIN   = 3, /* domain: don't know what this is */
320                 SID_NAME_ALIAS    = 4, /* local group */
321                 SID_NAME_WKN_GRP  = 5, /* well-known group */
322                 SID_NAME_DELETED  = 6, /* deleted account: needed for c2 rating */
323                 SID_NAME_INVALID  = 7, /* invalid account */
324                 SID_NAME_UNKNOWN  = 8, /* oops. */
325                 SID_NAME_COMPUTER = 9  /* machine */
326         } lsa_SidType;
327
328         typedef struct {
329                 lsa_SidType sid_type;
330                 uint32 rid;
331                 uint32 sid_index;
332         } lsa_TranslatedSid;
333
334         typedef struct {
335                 [range(0,1000)] uint32 count;
336                 [size_is(count)] lsa_TranslatedSid *sids;
337         } lsa_TransSidArray;
338
339         const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32;
340         typedef struct {
341                 [range(0,1000)] uint32 count;
342                 [size_is(count)] lsa_DomainInfo *domains;
343                 uint32 max_size;
344         } lsa_RefDomainList;
345
346         /* Level 1: Ask everywhere
347          * Level 2: Ask domain and trusted domains, no builtin and wkn
348          * Level 3: Only ask domain
349          * Level 4: W2k3ad: Only ask AD trusts
350          * Level 5: Only ask transitive forest trusts
351          * Level 6: Like 4
352          */
353
354         typedef enum {
355                 LSA_LOOKUP_NAMES_ALL = 1,
356                 LSA_LOOKUP_NAMES_DOMAINS_ONLY = 2,
357                 LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY = 3,
358                 LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY = 4,
359                 LSA_LOOKUP_NAMES_FOREST_TRUSTS_ONLY = 5,
360                 LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 = 6
361         } lsa_LookupNamesLevel;
362
363         [public] NTSTATUS lsa_LookupNames (
364                 [in]         policy_handle *handle,
365                 [in,range(0,1000)] uint32 num_names,
366                 [in,size_is(num_names)]  lsa_String names[],
367                 [out,unique] lsa_RefDomainList *domains,
368                 [in,out]     lsa_TransSidArray *sids,
369                 [in]         lsa_LookupNamesLevel level,
370                 [in,out]     uint32 *count
371                 );
372
373
374         /******************/
375         /* Function: 0x0f */
376
377         typedef struct {
378                 lsa_SidType sid_type;
379                 lsa_String name;
380                 uint32 sid_index;
381         } lsa_TranslatedName;
382
383         typedef struct {
384                 [range(0,1000)] uint32 count;
385                 [size_is(count)] lsa_TranslatedName *names;
386         } lsa_TransNameArray;
387
388         [public] NTSTATUS lsa_LookupSids (
389                 [in]         policy_handle *handle,
390                 [in]         lsa_SidArray *sids,
391                 [out,unique]        lsa_RefDomainList *domains,
392                 [in,out]     lsa_TransNameArray *names,
393                 [in]         uint16 level,
394                 [in,out] uint32 *count
395                 );
396
397
398         /* Function:        0x10 */
399         [public] NTSTATUS lsa_CreateSecret(
400                 [in]         policy_handle *handle,
401                 [in]         lsa_String       name,
402                 [in]         uint32         access_mask,
403                 [out]        policy_handle *sec_handle
404                 );
405
406
407         /*****************************************/
408         /* Function:     0x11                    */
409         NTSTATUS lsa_OpenAccount (
410                 [in]         policy_handle *handle,
411                 [in]         dom_sid2 *sid,
412                 [in]         uint32 access_mask,
413                 [out]        policy_handle *acct_handle
414                 );
415
416
417         /****************************************/
418         /* Function:    0x12                    */
419
420         typedef struct {
421                 lsa_LUID luid;
422                 uint32 attribute;
423         } lsa_LUIDAttribute;
424         
425         typedef struct {
426                 [range(0,1000)] uint32 count;
427                 uint32 unknown;
428                 [size_is(count)] lsa_LUIDAttribute set[*];
429         } lsa_PrivilegeSet;
430         
431         NTSTATUS lsa_EnumPrivsAccount (
432                 [in]         policy_handle *handle,
433                 [out,unique] lsa_PrivilegeSet *privs
434                 );
435
436
437         /****************************************/
438         /* Function:            0x13 */
439         NTSTATUS lsa_AddPrivilegesToAccount(
440                 [in]         policy_handle *handle,
441                 [in]         lsa_PrivilegeSet *privs
442                 );
443         
444
445         /****************************************/
446         /* Function:         0x14 */
447         NTSTATUS lsa_RemovePrivilegesFromAccount(
448                 [in]         policy_handle *handle,
449                 [in]         uint8 remove_all,
450                 [in,unique]  lsa_PrivilegeSet *privs
451                 );
452
453         /* Function:           0x15 */
454         NTSTATUS lsa_GetQuotasForAccount();
455         
456         /* Function:           0x16 */
457         NTSTATUS lsa_SetQuotasForAccount();
458         
459         /* Function:    0x17 */
460         NTSTATUS lsa_GetSystemAccessAccount();
461         /* Function:    0x18 */
462         NTSTATUS lsa_SetSystemAccessAccount();
463
464         /* Function:        0x19 */
465         NTSTATUS lsa_OpenTrustedDomain(
466                 [in]     policy_handle *handle,
467                 [in]     dom_sid2      *sid,
468                 [in]         uint32         access_mask,
469                 [out]    policy_handle *trustdom_handle
470                 );
471
472         typedef [flag(NDR_PAHEX)] struct {
473                 uint32 length;
474                 uint32 size;
475                 [size_is(size),length_is(length)] uint8 *data;
476         } lsa_DATA_BUF;
477
478         typedef [flag(NDR_PAHEX)] struct {
479                 [range(0,65536)] uint32 size;
480                 [size_is(size)] uint8 *data;
481         } lsa_DATA_BUF2;
482
483         typedef enum {
484                 LSA_TRUSTED_DOMAIN_INFO_NAME             = 1,
485                 LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO = 2,
486                 LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET     = 3,
487                 LSA_TRUSTED_DOMAIN_INFO_PASSWORD         = 4,
488                 LSA_TRUSTED_DOMAIN_INFO_BASIC            = 5,
489                 LSA_TRUSTED_DOMAIN_INFO_INFO_EX          = 6,
490                 LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO        = 7,
491                 LSA_TRUSTED_DOMAIN_INFO_FULL_INFO        = 8,
492                 LSA_TRUSTED_DOMAIN_INFO_11               = 11,
493                 LSA_TRUSTED_DOMAIN_INFO_INFO_ALL         = 12
494         } lsa_TrustDomInfoEnum;
495
496         typedef struct {
497                 lsa_StringLarge  netbios_name;
498         } lsa_TrustDomainInfoName;
499
500         typedef struct {
501                 uint32         posix_offset;
502         } lsa_TrustDomainInfoPosixOffset;
503
504         typedef struct {
505                 lsa_DATA_BUF  *password;
506                 lsa_DATA_BUF  *old_password;
507         } lsa_TrustDomainInfoPassword;
508
509         typedef struct {
510                 lsa_String     netbios_name;
511                 dom_sid2      *sid;
512         } lsa_TrustDomainInfoBasic;
513
514         typedef struct {
515                 lsa_StringLarge     domain_name;
516                 lsa_StringLarge     netbios_name;
517                 dom_sid2      *sid;
518                 uint32         trust_direction;
519                 uint32         trust_type;
520                 uint32         trust_attributes;
521         } lsa_TrustDomainInfoInfoEx;
522
523         typedef struct {
524                 NTTIME_hyper   last_update_time;
525                 uint32         secret_type;
526                 lsa_DATA_BUF2  data;
527         } lsa_TrustDomainInfoBuffer;
528
529         typedef struct {
530                 uint32 incoming_count;
531                 lsa_TrustDomainInfoBuffer *incoming_current_auth_info;
532                 lsa_TrustDomainInfoBuffer *incoming_previous_auth_info;
533                 uint32 outgoing_count;
534                 lsa_TrustDomainInfoBuffer *outgoing_current_auth_info;
535                 lsa_TrustDomainInfoBuffer *outgoing_previous_auth_info;
536         } lsa_TrustDomainInfoAuthInfo;
537
538         typedef struct {
539                 lsa_TrustDomainInfoInfoEx      info_ex;
540                 lsa_TrustDomainInfoPosixOffset posix_offset;
541                 lsa_TrustDomainInfoAuthInfo    auth_info;
542         } lsa_TrustDomainInfoFullInfo;
543
544         typedef struct {
545                 lsa_TrustDomainInfoInfoEx      info_ex;
546                 lsa_DATA_BUF2                  data1;
547         } lsa_TrustDomainInfo11;
548
549         typedef struct {
550                 lsa_TrustDomainInfoInfoEx      info_ex;
551                 lsa_DATA_BUF2                  data1;
552                 lsa_TrustDomainInfoPosixOffset posix_offset;
553                 lsa_TrustDomainInfoAuthInfo    auth_info;
554         } lsa_TrustDomainInfoInfoAll;
555
556         typedef [switch_type(lsa_TrustDomInfoEnum)] union {
557                 [case(LSA_TRUSTED_DOMAIN_INFO_NAME)]         lsa_TrustDomainInfoName        name;
558                 [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] lsa_TrustDomainInfoPosixOffset posix_offset;
559                 [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)]     lsa_TrustDomainInfoPassword    password;
560                 [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)]        lsa_TrustDomainInfoBasic       info_basic;
561                 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)]      lsa_TrustDomainInfoInfoEx      info_ex;
562                 [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)]    lsa_TrustDomainInfoAuthInfo    auth_info;
563                 [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)]    lsa_TrustDomainInfoFullInfo    full_info;
564                 [case(LSA_TRUSTED_DOMAIN_INFO_11)]           lsa_TrustDomainInfo11          info11;
565                 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_ALL)]     lsa_TrustDomainInfoInfoAll     info_all;
566         } lsa_TrustedDomainInfo;
567
568         /* Function:       0x1a */
569         NTSTATUS lsa_QueryTrustedDomainInfo(
570                 [in]     policy_handle                   *trustdom_handle,
571                 [in]     lsa_TrustDomInfoEnum             level, 
572                 [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
573                 );
574
575         /* Function:     0x1b */
576         NTSTATUS lsa_SetInformationTrustedDomain();
577
578         /* Function:          0x1c */
579         [public] NTSTATUS lsa_OpenSecret(
580                 [in]     policy_handle    *handle,
581                 [in]         lsa_String        name,
582                 [in]         uint32            access_mask,
583                 [out]    policy_handle    *sec_handle
584                 );
585
586         /* Function:           0x1d */
587
588         [public] NTSTATUS lsa_SetSecret(
589                 [in]     policy_handle    *sec_handle,
590                 [in,unique]         lsa_DATA_BUF     *new_val,
591                 [in,unique]         lsa_DATA_BUF     *old_val
592                 );
593
594         typedef struct {
595                 lsa_DATA_BUF *buf;
596         } lsa_DATA_BUF_PTR;
597
598         /* Function:         0x1e */
599         [public] NTSTATUS lsa_QuerySecret (
600                 [in]     policy_handle     *sec_handle,
601                 [in,out,unique]     lsa_DATA_BUF_PTR  *new_val,
602                 [in,out,unique]     NTTIME_hyper      *new_mtime,
603                 [in,out,unique]     lsa_DATA_BUF_PTR  *old_val,
604                 [in,out,unique]     NTTIME_hyper      *old_mtime
605                 );
606
607         /* Function:     0x1f */
608         NTSTATUS lsa_LookupPrivValue(
609                 [in]     policy_handle *handle,
610                 [in]     lsa_String *name,
611                 [out]    lsa_LUID *luid
612                 );
613
614
615         /* Function:      0x20 */
616         NTSTATUS lsa_LookupPrivName (
617                 [in]     policy_handle *handle,
618                 [in]     lsa_LUID *luid,
619                 [out,unique]        lsa_StringLarge *name
620                 );
621
622
623         /*******************/
624         /* Function:  0x21 */
625         NTSTATUS lsa_LookupPrivDisplayName (
626                 [in]     policy_handle *handle,
627                 [in]     lsa_String *name,
628                 [out,unique]        lsa_StringLarge *disp_name,
629                 /* see http://www.microsoft.com/globaldev/nlsweb/ for
630                    language definitions */
631                 [in,out] uint16 *language_id,
632                 [in]         uint16 unknown
633                 );
634
635         /* Function:        0x22 */
636         NTSTATUS lsa_DeleteObject();
637
638         
639         /*******************/
640         /* Function:      0x23 */
641         NTSTATUS lsa_EnumAccountsWithUserRight (
642                 [in]     policy_handle *handle,
643                 [in,unique]         lsa_String *name,
644                 [out]    lsa_SidArray *sids
645                 );
646
647         /* Function:      0x24 */
648         typedef struct {
649                 [string,charset(UTF16)] uint16 *name;
650         } lsa_RightAttribute;
651         
652         typedef struct {
653                 uint32 count;
654                 [size_is(count)] lsa_StringLarge *names;
655         } lsa_RightSet;
656         
657         NTSTATUS lsa_EnumAccountRights (
658                 [in]     policy_handle *handle,
659                 [in]     dom_sid2 *sid,
660                 [out]    lsa_RightSet *rights
661                 );
662
663
664         /**********************/
665         /* Function:       0x25 */
666         NTSTATUS lsa_AddAccountRights (
667                 [in]     policy_handle *handle,
668                 [in]     dom_sid2 *sid,
669                 [in]     lsa_RightSet *rights
670                 );
671         
672         /**********************/
673         /* Function:       0x26 */
674         NTSTATUS lsa_RemoveAccountRights (
675                 [in]     policy_handle *handle,
676                 [in]     dom_sid2 *sid,
677                 [in]         uint32 unknown,
678                 [in]     lsa_RightSet *rights
679                 );
680
681         /* Function:   0x27 */
682         NTSTATUS lsa_QueryTrustedDomainInfoBySid(
683                 [in]               policy_handle         *handle,
684                 [in]               dom_sid2              *dom_sid,
685                 [in]                   lsa_TrustDomInfoEnum  level, 
686                 [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
687         );
688
689         /* Function:     0x28 */
690         NTSTATUS lsa_SetTrustedDomainInfo();
691         /* Function:      0x29 */
692         NTSTATUS lsa_DeleteTrustedDomain(
693                 [in]               policy_handle         *handle,
694                 [in]               dom_sid2              *dom_sid
695         );
696
697         /* Function:       0x2a */
698         NTSTATUS lsa_StorePrivateData();
699         /* Function:        0x2b */
700         NTSTATUS lsa_RetrievePrivateData();
701
702
703         /**********************/
704         /* Function:     0x2c */
705         [public] NTSTATUS lsa_OpenPolicy2 (
706                 [in,unique]      [string,charset(UTF16)] uint16 *system_name,
707                 [in]  lsa_ObjectAttribute *attr,
708                 [in]      uint32 access_mask,
709                 [out] policy_handle *handle
710                 );
711
712         /**********************/
713         /* Function:     0x2d */
714         typedef struct {
715                 lsa_String *string;
716         } lsa_StringPointer;
717
718         NTSTATUS lsa_GetUserName(
719                 [in,unique] [string,charset(UTF16)] uint16 *system_name,
720                 [in,out,unique] lsa_String *account_name,
721                 [in,out,unique] lsa_StringPointer *authority_name
722                 );
723
724         /**********************/
725         /* Function:          0x2e */
726
727         NTSTATUS lsa_QueryInfoPolicy2(
728                 [in]                 policy_handle *handle,
729                 [in]                     lsa_PolicyInfo level,
730                 [out,unique,switch_is(level)]   lsa_PolicyInformation *info
731                 );
732
733         /* Function 0x2f */
734         NTSTATUS lsa_SetInfoPolicy2(
735                 [in]                            policy_handle *handle,
736                 [in]                            lsa_PolicyInfo level,
737                 [in,switch_is(level)]           lsa_PolicyInformation *info
738                 );
739
740         /**********************/
741         /* Function 0x30 */
742         NTSTATUS lsa_QueryTrustedDomainInfoByName(
743                 [in]                   policy_handle         *handle,
744                 [in]                   lsa_String             trusted_domain,
745                 [in]                   lsa_TrustDomInfoEnum   level, 
746                 [out,unique,switch_is(level)] lsa_TrustedDomainInfo *info
747                 );
748
749         /**********************/
750         /* Function 0x31 */
751         NTSTATUS lsa_SetTrustedDomainInfoByName(
752                 [in]                   policy_handle         *handle,
753                 [in]                   lsa_String             trusted_domain,
754                 [in]                   lsa_TrustDomInfoEnum   level, 
755                 [in,unique,switch_is(level)] lsa_TrustedDomainInfo *info
756                 );
757
758         /* Function 0x32 */
759
760         /* w2k3 treats max_size as max_domains*82       */
761         const int LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER = 82;
762
763         typedef struct {
764                 uint32 count;
765                 [size_is(count)] lsa_TrustDomainInfoInfoEx *domains;
766         } lsa_DomainListEx;
767
768         NTSTATUS lsa_EnumTrustedDomainsEx (
769                 [in]               policy_handle *handle,
770                 [in,out]           uint32 *resume_handle,
771                 [out]              lsa_DomainListEx *domains,
772                 [in]               uint32 max_size
773                 );
774
775
776         /* Function 0x33 */
777         NTSTATUS lsa_CreateTrustedDomainEx();
778
779         /* Function 0x34 */
780         NTSTATUS lsa_CloseTrustedDomainEx(
781                 [in,out]                   policy_handle         *handle
782         );
783
784         /* Function 0x35 */
785
786         /* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000 
787            for unknown6 - gd */
788         typedef struct {
789                 uint32 enforce_restrictions;
790                 hyper service_tkt_lifetime;
791                 hyper user_tkt_lifetime;
792                 hyper user_tkt_renewaltime;
793                 hyper clock_skew;
794                 hyper unknown6;
795         } lsa_DomainInfoKerberos;
796
797         typedef struct {
798                 uint32 blob_size;
799                 [size_is(blob_size)] uint8 *efs_blob;
800         } lsa_DomainInfoEfs;
801
802         typedef enum {
803                 LSA_DOMAIN_INFO_POLICY_EFS=2,
804                 LSA_DOMAIN_INFO_POLICY_KERBEROS=3
805         } lsa_DomainInfoEnum;
806
807         typedef [switch_type(uint16)] union {
808                 [case(LSA_DOMAIN_INFO_POLICY_EFS)]      lsa_DomainInfoEfs       efs_info;
809                 [case(LSA_DOMAIN_INFO_POLICY_KERBEROS)] lsa_DomainInfoKerberos  kerberos_info;
810         } lsa_DomainInformationPolicy;
811
812         NTSTATUS lsa_QueryDomainInformationPolicy(
813                 [in]            policy_handle *handle,
814                 [in]                    uint16 level,
815                 [out,unique,switch_is(level)]   lsa_DomainInformationPolicy *info
816                 );
817
818         /* Function 0x36 */
819         NTSTATUS lsa_SetDomainInformationPolicy(
820                 [in]            policy_handle *handle,
821                 [in]                    uint16 level,
822                 [in,unique,switch_is(level)]    lsa_DomainInformationPolicy *info
823                 );
824
825         /**********************/
826         /* Function 0x37 */
827         NTSTATUS lsa_OpenTrustedDomainByName(
828                 [in]     policy_handle *handle,
829                 [in]         lsa_String     name,
830                 [in]         uint32         access_mask,
831                 [out]    policy_handle *trustdom_handle
832                 );
833
834         /* Function 0x38 */
835         NTSTATUS lsa_TestCall();
836
837         /**********************/
838         /* Function 0x39 */
839
840         typedef struct {
841                 lsa_SidType sid_type;
842                 lsa_String name;
843                 uint32 sid_index;
844                 uint32 unknown;
845         } lsa_TranslatedName2;
846
847         typedef struct {
848                 [range(0,1000)] uint32 count;
849                 [size_is(count)] lsa_TranslatedName2 *names;
850         } lsa_TransNameArray2;
851
852         [public] NTSTATUS lsa_LookupSids2(
853                 [in]     policy_handle *handle,
854                 [in]     lsa_SidArray *sids,
855                 [out,unique]        lsa_RefDomainList *domains,
856                 [in,out] lsa_TransNameArray2 *names,
857                 [in]         uint16 level,
858                 [in,out] uint32 *count,
859                 [in]         uint32 unknown1,
860                 [in]         uint32 unknown2
861                 );
862
863         /**********************/
864         /* Function 0x3a */
865
866         typedef struct {
867                 lsa_SidType sid_type;
868                 uint32 rid;
869                 uint32 sid_index;
870                 uint32 unknown;
871         } lsa_TranslatedSid2;
872
873         typedef struct {
874                 [range(0,1000)] uint32 count;
875                 [size_is(count)] lsa_TranslatedSid2 *sids;
876         } lsa_TransSidArray2;
877
878         [public] NTSTATUS lsa_LookupNames2 (
879                 [in]     policy_handle *handle,
880                 [in,range(0,1000)] uint32 num_names,
881                 [in,size_is(num_names)]  lsa_String names[],
882                 [out,unique]        lsa_RefDomainList *domains,
883                 [in,out] lsa_TransSidArray2 *sids,
884                 [in]         lsa_LookupNamesLevel level,
885                 [in,out] uint32 *count,
886                 [in]         uint32 unknown1,
887                 [in]         uint32 unknown2
888                 );
889
890         /* Function 0x3b */
891         NTSTATUS lsa_CreateTrustedDomainEx2();
892
893         /* Function 0x3c */
894         NTSTATUS lsa_CREDRWRITE();
895
896         /* Function 0x3d */
897         NTSTATUS lsa_CREDRREAD();
898
899         /* Function 0x3e */
900         NTSTATUS lsa_CREDRENUMERATE();
901
902         /* Function 0x3f */
903         NTSTATUS lsa_CREDRWRITEDOMAINCREDENTIALS();
904
905         /* Function 0x40 */
906         NTSTATUS lsa_CREDRREADDOMAINCREDENTIALS();
907
908         /* Function 0x41 */
909         NTSTATUS lsa_CREDRDELETE();
910
911         /* Function 0x42 */
912         NTSTATUS lsa_CREDRGETTARGETINFO();
913
914         /* Function 0x43 */
915         NTSTATUS lsa_CREDRPROFILELOADED();
916
917         /**********************/
918         /* Function 0x44 */
919         typedef struct {
920                 lsa_SidType sid_type;
921                 dom_sid2 *sid;
922                 uint32 sid_index;
923                 uint32 unknown;
924         } lsa_TranslatedSid3;
925
926         typedef struct {
927                 [range(0,1000)] uint32 count;
928                 [size_is(count)] lsa_TranslatedSid3 *sids;
929         } lsa_TransSidArray3;
930
931         [public] NTSTATUS lsa_LookupNames3 (
932                 [in]     policy_handle *handle,
933                 [in,range(0,1000)] uint32 num_names,
934                 [in,size_is(num_names)]  lsa_String names[],
935                 [out,unique]        lsa_RefDomainList *domains,
936                 [in,out] lsa_TransSidArray3 *sids,
937                 [in]         lsa_LookupNamesLevel level,
938                 [in,out] uint32 *count,
939                 [in]         uint32 unknown1,
940                 [in]         uint32 unknown2
941                 );
942
943         /* Function 0x45 */
944         NTSTATUS lsa_CREDRGETSESSIONTYPES();
945
946         /* Function 0x46 */
947         NTSTATUS lsa_LSARREGISTERAUDITEVENT();
948
949         /* Function 0x47 */
950         NTSTATUS lsa_LSARGENAUDITEVENT();
951
952         /* Function 0x48 */
953         NTSTATUS lsa_LSARUNREGISTERAUDITEVENT();
954
955         /* Function 0x49 */
956         typedef struct {
957                 [range(0,131072)] uint32 length;
958                 [size_is(length)] uint8 *data;
959         } lsa_ForestTrustBinaryData;
960
961         typedef struct {
962                 dom_sid2 *domain_sid;
963                 lsa_StringLarge dns_domain_name;
964                 lsa_StringLarge netbios_domain_name;
965         } lsa_ForestTrustDomainInfo;
966
967         typedef [switch_type(uint32)] union {
968                 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] lsa_String top_level_name;
969                 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] lsa_StringLarge top_level_name_ex;
970                 [case(LSA_FOREST_TRUST_DOMAIN_INFO)] lsa_ForestTrustDomainInfo domain_info;
971                 [default] lsa_ForestTrustBinaryData data;
972         } lsa_ForestTrustData;
973
974         typedef [v1_enum] enum {
975                 LSA_FOREST_TRUST_TOP_LEVEL_NAME = 0,
976                 LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX = 1,
977                 LSA_FOREST_TRUST_DOMAIN_INFO = 2,
978                 LSA_FOREST_TRUST_RECORD_TYPE_LAST = 3
979         } lsa_ForestTrustRecordType;
980
981         typedef struct {
982                 uint32 flags;
983                 lsa_ForestTrustRecordType level;
984                 hyper unknown;
985                 [switch_is(level)] lsa_ForestTrustData forest_trust_data;
986         } lsa_ForestTrustRecord;
987
988         typedef [public] struct {
989                 [range(0,4000)] uint32 count;
990                 [size_is(count)] lsa_ForestTrustRecord **entries;
991         } lsa_ForestTrustInformation;
992
993         NTSTATUS lsa_lsaRQueryForestTrustInformation(
994                 [in] policy_handle *handle,
995                 [in,ref] lsa_String *trusted_domain_name,
996                 [in] uint16 unknown, /* level ? */
997                 [out,ref] lsa_ForestTrustInformation **forest_trust_info
998                 );
999
1000         /* Function 0x4a */
1001         NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION();
1002
1003         /* Function 0x4b */
1004         NTSTATUS lsa_CREDRRENAME();
1005
1006         /*****************/
1007         /* Function 0x4c */
1008
1009         [public] NTSTATUS lsa_LookupSids3(
1010                 [in]         lsa_SidArray *sids,
1011                 [out,unique] lsa_RefDomainList *domains,
1012                 [in,out]     lsa_TransNameArray2 *names,
1013                 [in]         uint16 level,
1014                 [in,out]     uint32 *count,
1015                 [in]         uint32 unknown1,
1016                 [in]         uint32 unknown2
1017                 );
1018
1019         /* Function 0x4d */
1020         NTSTATUS lsa_LookupNames4(
1021                 [in,range(0,1000)] uint32 num_names,
1022                 [in,size_is(num_names)]  lsa_String names[],
1023                 [out,unique]        lsa_RefDomainList *domains,
1024                 [in,out] lsa_TransSidArray3 *sids,
1025                 [in]         lsa_LookupNamesLevel level,
1026                 [in,out] uint32 *count,
1027                 [in]         uint32 unknown1,
1028                 [in]         uint32 unknown2
1029                 );
1030
1031         /* Function 0x4e */
1032         NTSTATUS lsa_LSAROPENPOLICYSCE();
1033
1034         /* Function 0x4f */
1035         NTSTATUS lsa_LSARADTREGISTERSECURITYEVENTSOURCE();
1036
1037         /* Function 0x50 */
1038         NTSTATUS lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE();
1039
1040         /* Function 0x51 */
1041         NTSTATUS lsa_LSARADTREPORTSECURITYEVENT();
1042
1043 }