~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to librpc/idl/lsa.idl

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

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