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