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