r23629: Document lsa lookupname lookuplevels Volker discovered a while ago.
[kai/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         declare bitmap 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         } lsaPolicyInfo;
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]                            uint16 level,
237                 [out,unique,switch_is(level)]   lsa_PolicyInformation *info
238                 );
239
240         /******************/
241         /* Function:       0x08 */
242         NTSTATUS lsa_SetInfoPolicy ();
243
244         /******************/
245         /* Function:       0x09 */
246         NTSTATUS lsa_ClearAuditLog ();
247
248         /******************/
249         /* Function: 0x0a */
250         [public] NTSTATUS lsa_CreateAccount (
251                 [in]    policy_handle *handle,
252                 [in]    dom_sid2 *sid,
253                 [in]    uint32 access_mask,
254                 [out]   policy_handle *acct_handle
255                 );
256
257         /******************/
258         /* NOTE: This only returns accounts that have at least
259            one privilege set 
260         */
261         /* Function: 0x0b */
262         typedef struct {
263                 dom_sid2 *sid;
264         } lsa_SidPtr;
265         
266         typedef [public] struct {
267                 [range(0,1000)] uint32 num_sids;
268                 [size_is(num_sids)] lsa_SidPtr *sids;
269         } lsa_SidArray;
270
271         [public] NTSTATUS lsa_EnumAccounts (
272                 [in]         policy_handle *handle,
273                 [in,out]     uint32 *resume_handle,
274                 [in,range(0,8192)] uint32 num_entries,
275                 [out]        lsa_SidArray *sids
276                 );
277
278
279         /*************************************************/
280         /* Function: 0x0c                                */
281
282         [public] NTSTATUS lsa_CreateTrustedDomain(
283                 [in]         policy_handle *handle,
284                 [in]         lsa_DomainInfo *info,
285                 [in]         uint32 access_mask,
286                 [out]        policy_handle *trustdom_handle
287                 );
288
289
290         /******************/
291         /* Function: 0x0d */
292
293         /* w2k3 treats max_size as max_domains*60       */
294         const int LSA_ENUM_TRUST_DOMAIN_MULTIPLIER = 60;
295
296         typedef struct {
297                 uint32 count;
298                 [size_is(count)] lsa_DomainInfo *domains;
299         } lsa_DomainList;
300
301         NTSTATUS lsa_EnumTrustDom (
302                 [in]               policy_handle *handle,
303                 [in,out]           uint32 *resume_handle,
304                 [in,range(0,1000)] uint32 max_size,
305                 [out]              lsa_DomainList *domains
306                 );
307
308
309         /******************/
310         /* Function: 0x0e */
311         typedef enum {
312                 SID_NAME_USE_NONE = 0,/* NOTUSED */
313                 SID_NAME_USER     = 1, /* user */
314                 SID_NAME_DOM_GRP  = 2, /* domain group */
315                 SID_NAME_DOMAIN   = 3, /* domain: don't know what this is */
316                 SID_NAME_ALIAS    = 4, /* local group */
317                 SID_NAME_WKN_GRP  = 5, /* well-known group */
318                 SID_NAME_DELETED  = 6, /* deleted account: needed for c2 rating */
319                 SID_NAME_INVALID  = 7, /* invalid account */
320                 SID_NAME_UNKNOWN  = 8, /* oops. */
321                 SID_NAME_COMPUTER = 9  /* machine */
322         } lsa_SidType;
323
324         typedef struct {
325                 lsa_SidType sid_type;
326                 uint32 rid;
327                 uint32 sid_index;
328         } lsa_TranslatedSid;
329
330         typedef struct {
331                 [range(0,1000)] uint32 count;
332                 [size_is(count)] lsa_TranslatedSid *sids;
333         } lsa_TransSidArray;
334
335         const int LSA_REF_DOMAIN_LIST_MULTIPLIER = 32;
336         typedef struct {
337                 [range(0,1000)] uint32 count;
338                 [size_is(count)] lsa_DomainInfo *domains;
339                 uint32 max_size;
340         } lsa_RefDomainList;
341
342         /* Level 1: Ask everywhere
343          * Level 2: Ask domain and trusted domains, no builtin and wkn
344          * Level 3: Only ask domain
345          * Level 4: W2k3ad: Only ask AD trusts
346          * Level 5: Don't lookup anything
347          * Level 6: Like 4
348          */
349
350         typedef enum {
351                 LSA_LOOKUP_NAMES_ALL = 1,
352                 LSA_LOOKUP_NAMES_DOMAINS_ONLY = 2,
353                 LSA_LOOKUP_NAMES_PRIMARY_DOMAIN_ONLY = 3,
354                 LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY = 4,
355                 LSA_LOOKUP_NAMES_NONE = 5,
356                 LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 = 6
357         } lsa_LookupNamesLevel;
358
359         [public] NTSTATUS lsa_LookupNames (
360                 [in]         policy_handle *handle,
361                 [in,range(0,1000)] uint32 num_names,
362                 [in,size_is(num_names)]  lsa_String names[],
363                 [out,unique] lsa_RefDomainList *domains,
364                 [in,out]     lsa_TransSidArray *sids,
365                 [in]         lsa_LookupNamesLevel level,
366                 [in,out]     uint32 *count
367                 );
368
369
370         /******************/
371         /* Function: 0x0f */
372
373         typedef struct {
374                 lsa_SidType sid_type;
375                 lsa_String name;
376                 uint32 sid_index;
377         } lsa_TranslatedName;
378
379         typedef struct {
380                 [range(0,1000)] uint32 count;
381                 [size_is(count)] lsa_TranslatedName *names;
382         } lsa_TransNameArray;
383
384         [public] NTSTATUS lsa_LookupSids (
385                 [in]         policy_handle *handle,
386                 [in]         lsa_SidArray *sids,
387                 [out,unique]        lsa_RefDomainList *domains,
388                 [in,out]     lsa_TransNameArray *names,
389                 [in]         uint16 level,
390                 [in,out] uint32 *count
391                 );
392
393
394         /* Function:        0x10 */
395         [public] NTSTATUS lsa_CreateSecret(
396                 [in]         policy_handle *handle,
397                 [in]         lsa_String       name,
398                 [in]         uint32         access_mask,
399                 [out]        policy_handle *sec_handle
400                 );
401
402
403         /*****************************************/
404         /* Function:     0x11                    */
405         NTSTATUS lsa_OpenAccount (
406                 [in]         policy_handle *handle,
407                 [in]         dom_sid2 *sid,
408                 [in]         uint32 access_mask,
409                 [out]        policy_handle *acct_handle
410                 );
411
412
413         /****************************************/
414         /* Function:    0x12                    */
415
416         typedef struct {
417                 lsa_LUID luid;
418                 uint32 attribute;
419         } lsa_LUIDAttribute;
420         
421         typedef struct {
422                 [range(0,1000)] uint32 count;
423                 uint32 unknown;
424                 [size_is(count)] lsa_LUIDAttribute set[*];
425         } lsa_PrivilegeSet;
426         
427         NTSTATUS lsa_EnumPrivsAccount (
428                 [in]         policy_handle *handle,
429                 [out,unique] lsa_PrivilegeSet *privs
430                 );
431
432
433         /****************************************/
434         /* Function:            0x13 */
435         NTSTATUS lsa_AddPrivilegesToAccount(
436                 [in]         policy_handle *handle,
437                 [in]         lsa_PrivilegeSet *privs
438                 );
439         
440
441         /****************************************/
442         /* Function:         0x14 */
443         NTSTATUS lsa_RemovePrivilegesFromAccount(
444                 [in]         policy_handle *handle,
445                 [in]         uint8 remove_all,
446                 [in,unique]  lsa_PrivilegeSet *privs
447                 );
448
449         /* Function:           0x15 */
450         NTSTATUS lsa_GetQuotasForAccount();
451         
452         /* Function:           0x16 */
453         NTSTATUS lsa_SetQuotasForAccount();
454         
455         /* Function:    0x17 */
456         NTSTATUS lsa_GetSystemAccessAccount();
457         /* Function:    0x18 */
458         NTSTATUS lsa_SetSystemAccessAccount();
459
460         /* Function:        0x19 */
461         NTSTATUS lsa_OpenTrustedDomain(
462                 [in]     policy_handle *handle,
463                 [in]     dom_sid2      *sid,
464                 [in]         uint32         access_mask,
465                 [out]    policy_handle *trustdom_handle
466                 );
467
468         typedef [flag(NDR_PAHEX)] struct {
469                 uint32 length;
470                 uint32 size;
471                 [size_is(size),length_is(length)] uint8 *data;
472         } lsa_DATA_BUF;
473
474         typedef [flag(NDR_PAHEX)] struct {
475                 [range(0,65536)] uint32 size;
476                 [size_is(size)] uint8 *data;
477         } lsa_DATA_BUF2;
478
479         typedef enum {
480                 LSA_TRUSTED_DOMAIN_INFO_NAME             = 1,
481                 LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS_INFO = 2,
482                 LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET     = 3,
483                 LSA_TRUSTED_DOMAIN_INFO_PASSWORD         = 4,
484                 LSA_TRUSTED_DOMAIN_INFO_BASIC            = 5,
485                 LSA_TRUSTED_DOMAIN_INFO_INFO_EX          = 6,
486                 LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO        = 7,
487                 LSA_TRUSTED_DOMAIN_INFO_FULL_INFO        = 8,
488                 LSA_TRUSTED_DOMAIN_INFO_11               = 11,
489                 LSA_TRUSTED_DOMAIN_INFO_INFO_ALL         = 12
490         } lsa_TrustDomInfoEnum;
491
492         typedef struct {
493                 lsa_StringLarge  netbios_name;
494         } lsa_TrustDomainInfoName;
495
496         typedef struct {
497                 uint32         posix_offset;
498         } lsa_TrustDomainInfoPosixOffset;
499
500         typedef struct {
501                 lsa_DATA_BUF  *password;
502                 lsa_DATA_BUF  *old_password;
503         } lsa_TrustDomainInfoPassword;
504
505         typedef struct {
506                 lsa_String     netbios_name;
507                 dom_sid2      *sid;
508         } lsa_TrustDomainInfoBasic;
509
510         typedef struct {
511                 lsa_StringLarge     domain_name;
512                 lsa_StringLarge     netbios_name;
513                 dom_sid2      *sid;
514                 uint32         trust_direction;
515                 uint32         trust_type;
516                 uint32         trust_attributes;
517         } lsa_TrustDomainInfoInfoEx;
518
519         typedef struct {
520                 NTTIME_hyper   last_update_time;
521                 uint32         secret_type;
522                 lsa_DATA_BUF2  data;
523         } lsa_TrustDomainInfoBuffer;
524
525         typedef struct {
526                 uint32 incoming_count;
527                 lsa_TrustDomainInfoBuffer *incoming_current_auth_info;
528                 lsa_TrustDomainInfoBuffer *incoming_previous_auth_info;
529                 uint32 outgoing_count;
530                 lsa_TrustDomainInfoBuffer *outgoing_current_auth_info;
531                 lsa_TrustDomainInfoBuffer *outgoing_previous_auth_info;
532         } lsa_TrustDomainInfoAuthInfo;
533
534         typedef struct {
535                 lsa_TrustDomainInfoInfoEx      info_ex;
536                 lsa_TrustDomainInfoPosixOffset posix_offset;
537                 lsa_TrustDomainInfoAuthInfo    auth_info;
538         } lsa_TrustDomainInfoFullInfo;
539
540         typedef struct {
541                 lsa_TrustDomainInfoInfoEx      info_ex;
542                 lsa_DATA_BUF2                  data1;
543         } lsa_TrustDomainInfo11;
544
545         typedef struct {
546                 lsa_TrustDomainInfoInfoEx      info_ex;
547                 lsa_DATA_BUF2                  data1;
548                 lsa_TrustDomainInfoPosixOffset posix_offset;
549                 lsa_TrustDomainInfoAuthInfo    auth_info;
550         } lsa_TrustDomainInfoInfoAll;
551
552         typedef [switch_type(lsa_TrustDomInfoEnum)] union {
553                 [case(LSA_TRUSTED_DOMAIN_INFO_NAME)]         lsa_TrustDomainInfoName        name;
554                 [case(LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET)] lsa_TrustDomainInfoPosixOffset posix_offset;
555                 [case(LSA_TRUSTED_DOMAIN_INFO_PASSWORD)]     lsa_TrustDomainInfoPassword    password;
556                 [case(LSA_TRUSTED_DOMAIN_INFO_BASIC)]        lsa_TrustDomainInfoBasic       info_basic;
557                 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_EX)]      lsa_TrustDomainInfoInfoEx      info_ex;
558                 [case(LSA_TRUSTED_DOMAIN_INFO_AUTH_INFO)]    lsa_TrustDomainInfoAuthInfo    auth_info;
559                 [case(LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)]    lsa_TrustDomainInfoFullInfo    full_info;
560                 [case(LSA_TRUSTED_DOMAIN_INFO_11)]           lsa_TrustDomainInfo11          info11;
561                 [case(LSA_TRUSTED_DOMAIN_INFO_INFO_ALL)]     lsa_TrustDomainInfoInfoAll     info_all;
562         } lsa_TrustedDomainInfo;
563
564         /* Function:       0x1a */
565         NTSTATUS lsa_QueryTrustedDomainInfo(
566                 [in]     policy_handle                   *trustdom_handle,
567                 [in]     lsa_TrustDomInfoEnum             level, 
568                 [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
569                 );
570
571         /* Function:     0x1b */
572         NTSTATUS lsa_SetInformationTrustedDomain();
573
574         /* Function:          0x1c */
575         [public] NTSTATUS lsa_OpenSecret(
576                 [in]     policy_handle    *handle,
577                 [in]         lsa_String        name,
578                 [in]         uint32            access_mask,
579                 [out]    policy_handle    *sec_handle
580                 );
581
582         /* Function:           0x1d */
583
584         [public] NTSTATUS lsa_SetSecret(
585                 [in]     policy_handle    *sec_handle,
586                 [in,unique]         lsa_DATA_BUF     *new_val,
587                 [in,unique]         lsa_DATA_BUF     *old_val
588                 );
589
590         typedef struct {
591                 lsa_DATA_BUF *buf;
592         } lsa_DATA_BUF_PTR;
593
594         /* Function:         0x1e */
595         [public] NTSTATUS lsa_QuerySecret (
596                 [in]     policy_handle     *sec_handle,
597                 [in,out,unique]     lsa_DATA_BUF_PTR  *new_val,
598                 [in,out,unique]     NTTIME_hyper      *new_mtime,
599                 [in,out,unique]     lsa_DATA_BUF_PTR  *old_val,
600                 [in,out,unique]     NTTIME_hyper      *old_mtime
601                 );
602
603         /* Function:     0x1f */
604         NTSTATUS lsa_LookupPrivValue(
605                 [in]     policy_handle *handle,
606                 [in]     lsa_String *name,
607                 [out]    lsa_LUID *luid
608                 );
609
610
611         /* Function:      0x20 */
612         NTSTATUS lsa_LookupPrivName (
613                 [in]     policy_handle *handle,
614                 [in]     lsa_LUID *luid,
615                 [out,unique]        lsa_StringLarge *name
616                 );
617
618
619         /*******************/
620         /* Function:  0x21 */
621         NTSTATUS lsa_LookupPrivDisplayName (
622                 [in]     policy_handle *handle,
623                 [in]     lsa_String *name,
624                 [out,unique]        lsa_StringLarge *disp_name,
625                 /* see http://www.microsoft.com/globaldev/nlsweb/ for
626                    language definitions */
627                 [in,out] uint16 *language_id,
628                 [in]         uint16 unknown
629                 );
630
631         /* Function:        0x22 */
632         NTSTATUS lsa_DeleteObject();
633
634         
635         /*******************/
636         /* Function:      0x23 */
637         NTSTATUS lsa_EnumAccountsWithUserRight (
638                 [in]     policy_handle *handle,
639                 [in,unique]         lsa_String *name,
640                 [out]    lsa_SidArray *sids
641                 );
642
643         /* Function:      0x24 */
644         typedef struct {
645                 [string,charset(UTF16)] uint16 *name;
646         } lsa_RightAttribute;
647         
648         typedef struct {
649                 uint32 count;
650                 [size_is(count)] lsa_StringLarge *names;
651         } lsa_RightSet;
652         
653         NTSTATUS lsa_EnumAccountRights (
654                 [in]     policy_handle *handle,
655                 [in]     dom_sid2 *sid,
656                 [out]    lsa_RightSet *rights
657                 );
658
659
660         /**********************/
661         /* Function:       0x25 */
662         NTSTATUS lsa_AddAccountRights (
663                 [in]     policy_handle *handle,
664                 [in]     dom_sid2 *sid,
665                 [in]     lsa_RightSet *rights
666                 );
667         
668         /**********************/
669         /* Function:       0x26 */
670         NTSTATUS lsa_RemoveAccountRights (
671                 [in]     policy_handle *handle,
672                 [in]     dom_sid2 *sid,
673                 [in]         uint32 unknown,
674                 [in]     lsa_RightSet *rights
675                 );
676
677         /* Function:   0x27 */
678         NTSTATUS lsa_QueryTrustedDomainInfoBySid(
679                 [in]               policy_handle         *handle,
680                 [in]               dom_sid2              *dom_sid,
681                 [in]                   lsa_TrustDomInfoEnum  level, 
682                 [out,switch_is(level),unique] lsa_TrustedDomainInfo *info
683         );
684
685         /* Function:     0x28 */
686         NTSTATUS lsa_SetTrustedDomainInfo();
687         /* Function:      0x29 */
688         NTSTATUS lsa_DeleteTrustedDomain(
689                 [in]               policy_handle         *handle,
690                 [in]               dom_sid2              *dom_sid
691         );
692
693         /* Function:       0x2a */
694         NTSTATUS lsa_StorePrivateData();
695         /* Function:        0x2b */
696         NTSTATUS lsa_RetrievePrivateData();
697
698
699         /**********************/
700         /* Function:     0x2c */
701         [public] NTSTATUS lsa_OpenPolicy2 (
702                 [in,unique]      [string,charset(UTF16)] uint16 *system_name,
703                 [in]  lsa_ObjectAttribute *attr,
704                 [in]      uint32 access_mask,
705                 [out] policy_handle *handle
706                 );
707
708         /**********************/
709         /* Function:     0x2d */
710         typedef struct {
711                 lsa_String *string;
712         } lsa_StringPointer;
713
714         NTSTATUS lsa_GetUserName(
715                 [in,unique] [string,charset(UTF16)] uint16 *system_name,
716                 [in,out,unique] lsa_String *account_name,
717                 [in,out,unique] lsa_StringPointer *authority_name
718                 );
719
720         /**********************/
721         /* Function:          0x2e */
722
723         NTSTATUS lsa_QueryInfoPolicy2(
724                 [in]                 policy_handle *handle,
725                 [in]                     uint16 level,
726                 [out,unique,switch_is(level)]   lsa_PolicyInformation *info
727                 );
728
729         /* Function 0x2f */
730         NTSTATUS lsa_SetInfoPolicy2();
731
732         /**********************/
733         /* Function 0x30 */
734         NTSTATUS lsa_QueryTrustedDomainInfoByName(
735                 [in]                   policy_handle         *handle,
736                 [in]                   lsa_String             trusted_domain,
737                 [in]                   lsa_TrustDomInfoEnum   level, 
738                 [out,unique,switch_is(level)] lsa_TrustedDomainInfo *info
739                 );
740
741         /**********************/
742         /* Function 0x31 */
743         NTSTATUS lsa_SetTrustedDomainInfoByName(
744                 [in]                   policy_handle         *handle,
745                 [in]                   lsa_String             trusted_domain,
746                 [in]                   lsa_TrustDomInfoEnum   level, 
747                 [in,unique,switch_is(level)] lsa_TrustedDomainInfo *info
748                 );
749
750         /* Function 0x32 */
751
752         /* w2k3 treats max_size as max_domains*82       */
753         const int LSA_ENUM_TRUST_DOMAIN_EX_MULTIPLIER = 82;
754
755         typedef struct {
756                 uint32 count;
757                 [size_is(count)] lsa_TrustDomainInfoInfoEx *domains;
758         } lsa_DomainListEx;
759
760         NTSTATUS lsa_EnumTrustedDomainsEx (
761                 [in]               policy_handle *handle,
762                 [in,out]           uint32 *resume_handle,
763                 [out]              lsa_DomainListEx *domains,
764                 [in]               uint32 max_size
765                 );
766
767
768         /* Function 0x33 */
769         NTSTATUS lsa_CreateTrustedDomainEx();
770
771         /* Function 0x34 */
772         NTSTATUS lsa_CloseTrustedDomainEx(
773                 [in,out]                   policy_handle         *handle
774         );
775
776         /* Function 0x35 */
777
778         /* w2k3 returns either 0x000bbbd000000000 or 0x000a48e800000000 
779            for unknown6 - gd */
780         typedef struct {
781                 uint32 enforce_restrictions;
782                 hyper service_tkt_lifetime;
783                 hyper user_tkt_lifetime;
784                 hyper user_tkt_renewaltime;
785                 hyper clock_skew;
786                 hyper unknown6;
787         } lsa_DomainInfoKerberos;
788
789         typedef struct {
790                 uint32 blob_size;
791                 [size_is(blob_size)] uint8 *efs_blob;
792         } lsa_DomainInfoEfs;
793
794         typedef enum {
795                 LSA_DOMAIN_INFO_POLICY_EFS=2,
796                 LSA_DOMAIN_INFO_POLICY_KERBEROS=3
797         } lsa_DomainInfoEnum;
798
799         typedef [switch_type(uint16)] union {
800                 [case(LSA_DOMAIN_INFO_POLICY_EFS)]      lsa_DomainInfoEfs       efs_info;
801                 [case(LSA_DOMAIN_INFO_POLICY_KERBEROS)] lsa_DomainInfoKerberos  kerberos_info;
802         } lsa_DomainInformationPolicy;
803
804         NTSTATUS lsa_QueryDomainInformationPolicy(
805                 [in]            policy_handle *handle,
806                 [in]                    uint16 level,
807                 [out,unique,switch_is(level)]   lsa_DomainInformationPolicy *info
808                 );
809
810         /* Function 0x36 */
811         NTSTATUS lsa_SetDomainInformationPolicy(
812                 [in]            policy_handle *handle,
813                 [in]                    uint16 level,
814                 [in,unique,switch_is(level)]    lsa_DomainInformationPolicy *info
815                 );
816
817         /**********************/
818         /* Function 0x37 */
819         NTSTATUS lsa_OpenTrustedDomainByName(
820                 [in]     policy_handle *handle,
821                 [in]         lsa_String     name,
822                 [in]         uint32         access_mask,
823                 [out]    policy_handle *trustdom_handle
824                 );
825
826         /* Function 0x38 */
827         NTSTATUS lsa_TestCall();
828
829         /**********************/
830         /* Function 0x39 */
831
832         typedef struct {
833                 lsa_SidType sid_type;
834                 lsa_String name;
835                 uint32 sid_index;
836                 uint32 unknown;
837         } lsa_TranslatedName2;
838
839         typedef struct {
840                 [range(0,1000)] uint32 count;
841                 [size_is(count)] lsa_TranslatedName2 *names;
842         } lsa_TransNameArray2;
843
844         [public] NTSTATUS lsa_LookupSids2(
845                 [in]     policy_handle *handle,
846                 [in]     lsa_SidArray *sids,
847                 [out,unique]        lsa_RefDomainList *domains,
848                 [in,out] lsa_TransNameArray2 *names,
849                 [in]         uint16 level,
850                 [in,out] uint32 *count,
851                 [in]         uint32 unknown1,
852                 [in]         uint32 unknown2
853                 );
854
855         /**********************/
856         /* Function 0x3a */
857
858         typedef struct {
859                 lsa_SidType sid_type;
860                 uint32 rid;
861                 uint32 sid_index;
862                 uint32 unknown;
863         } lsa_TranslatedSid2;
864
865         typedef struct {
866                 [range(0,1000)] uint32 count;
867                 [size_is(count)] lsa_TranslatedSid2 *sids;
868         } lsa_TransSidArray2;
869
870         [public] NTSTATUS lsa_LookupNames2 (
871                 [in]     policy_handle *handle,
872                 [in,range(0,1000)] uint32 num_names,
873                 [in,size_is(num_names)]  lsa_String names[],
874                 [out,unique]        lsa_RefDomainList *domains,
875                 [in,out] lsa_TransSidArray2 *sids,
876                 [in]         lsa_LookupNamesLevel level,
877                 [in,out] uint32 *count,
878                 [in]         uint32 unknown1,
879                 [in]         uint32 unknown2
880                 );
881
882         /* Function 0x3b */
883         NTSTATUS lsa_CreateTrustedDomainEx2();
884
885         /* Function 0x3c */
886         NTSTATUS lsa_CREDRWRITE();
887
888         /* Function 0x3d */
889         NTSTATUS lsa_CREDRREAD();
890
891         /* Function 0x3e */
892         NTSTATUS lsa_CREDRENUMERATE();
893
894         /* Function 0x3f */
895         NTSTATUS lsa_CREDRWRITEDOMAINCREDENTIALS();
896
897         /* Function 0x40 */
898         NTSTATUS lsa_CREDRREADDOMAINCREDENTIALS();
899
900         /* Function 0x41 */
901         NTSTATUS lsa_CREDRDELETE();
902
903         /* Function 0x42 */
904         NTSTATUS lsa_CREDRGETTARGETINFO();
905
906         /* Function 0x43 */
907         NTSTATUS lsa_CREDRPROFILELOADED();
908
909         /**********************/
910         /* Function 0x44 */
911         typedef struct {
912                 lsa_SidType sid_type;
913                 dom_sid2 *sid;
914                 uint32 sid_index;
915                 uint32 unknown;
916         } lsa_TranslatedSid3;
917
918         typedef struct {
919                 [range(0,1000)] uint32 count;
920                 [size_is(count)] lsa_TranslatedSid3 *sids;
921         } lsa_TransSidArray3;
922
923         [public] NTSTATUS lsa_LookupNames3 (
924                 [in]     policy_handle *handle,
925                 [in,range(0,1000)] uint32 num_names,
926                 [in,size_is(num_names)]  lsa_String names[],
927                 [out,unique]        lsa_RefDomainList *domains,
928                 [in,out] lsa_TransSidArray3 *sids,
929                 [in]         lsa_LookupNamesLevel level,
930                 [in,out] uint32 *count,
931                 [in]         uint32 unknown1,
932                 [in]         uint32 unknown2
933                 );
934
935         /* Function 0x45 */
936         NTSTATUS lsa_CREDRGETSESSIONTYPES();
937
938         /* Function 0x46 */
939         NTSTATUS lsa_LSARREGISTERAUDITEVENT();
940
941         /* Function 0x47 */
942         NTSTATUS lsa_LSARGENAUDITEVENT();
943
944         /* Function 0x48 */
945         NTSTATUS lsa_LSARUNREGISTERAUDITEVENT();
946
947         /* Function 0x49 */
948         typedef struct {
949                 [range(0,131072)] uint32 length;
950                 [size_is(length)] uint8 *data;
951         } lsa_ForestTrustBinaryData;
952
953         typedef struct {
954                 dom_sid2 *domain_sid;
955                 lsa_StringLarge dns_domain_name;
956                 lsa_StringLarge netbios_domain_name;
957         } lsa_ForestTrustDomainInfo;
958
959         typedef [switch_type(uint32)] union {
960                 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME)] lsa_String top_level_name;
961                 [case(LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX)] lsa_StringLarge top_level_name_ex;
962                 [case(LSA_FOREST_TRUST_DOMAIN_INFO)] lsa_ForestTrustDomainInfo domain_info;
963                 [default] lsa_ForestTrustBinaryData data;
964         } lsa_ForestTrustData;
965
966         typedef [v1_enum] enum {
967                 LSA_FOREST_TRUST_TOP_LEVEL_NAME = 0,
968                 LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX = 1,
969                 LSA_FOREST_TRUST_DOMAIN_INFO = 2,
970                 LSA_FOREST_TRUST_RECORD_TYPE_LAST = 3
971         } lsa_ForestTrustRecordType;
972
973         typedef struct {
974                 uint32 flags;
975                 lsa_ForestTrustRecordType level;
976                 hyper unknown;
977                 [switch_is(level)] lsa_ForestTrustData forest_trust_data;
978         } lsa_ForestTrustRecord;
979
980         typedef [public] struct {
981                 [range(0,4000)] uint32 count;
982                 [size_is(count)] lsa_ForestTrustRecord **entries;
983         } lsa_ForestTrustInformation;
984
985         NTSTATUS lsa_lsaRQueryForestTrustInformation(
986                 [in] policy_handle *handle,
987                 [in,ref] lsa_String *trusted_domain_name,
988                 [in] uint16 unknown, /* level ? */
989                 [out,ref] lsa_ForestTrustInformation **forest_trust_info
990                 );
991
992         /* Function 0x4a */
993         NTSTATUS lsa_LSARSETFORESTTRUSTINFORMATION();
994
995         /* Function 0x4b */
996         NTSTATUS lsa_CREDRRENAME();
997
998         /*****************/
999         /* Function 0x4c */
1000
1001         [public] NTSTATUS lsa_LookupSids3(
1002                 [in]         lsa_SidArray *sids,
1003                 [out,unique] lsa_RefDomainList *domains,
1004                 [in,out]     lsa_TransNameArray2 *names,
1005                 [in]         uint16 level,
1006                 [in,out]     uint32 *count,
1007                 [in]         uint32 unknown1,
1008                 [in]         uint32 unknown2
1009                 );
1010
1011         /* Function 0x4d */
1012         NTSTATUS lsa_LookupNames4(
1013                 [in,range(0,1000)] uint32 num_names,
1014                 [in,size_is(num_names)]  lsa_String names[],
1015                 [out,unique]        lsa_RefDomainList *domains,
1016                 [in,out] lsa_TransSidArray3 *sids,
1017                 [in]         lsa_LookupNamesLevel level,
1018                 [in,out] uint32 *count,
1019                 [in]         uint32 unknown1,
1020                 [in]         uint32 unknown2
1021                 );
1022
1023         /* Function 0x4e */
1024         NTSTATUS lsa_LSAROPENPOLICYSCE();
1025
1026         /* Function 0x4f */
1027         NTSTATUS lsa_LSARADTREGISTERSECURITYEVENTSOURCE();
1028
1029         /* Function 0x50 */
1030         NTSTATUS lsa_LSARADTUNREGISTERSECURITYEVENTSOURCE();
1031
1032         /* Function 0x51 */
1033         NTSTATUS lsa_LSARADTREPORTSECURITYEVENT();
1034
1035 }