f84addf150cf8dbb32ca2ba731ac1bac2462030a
[samba.git] / source / librpc / idl / lsa.idl
1 #include "idl_types.h"
2
3 /*
4   lsa interface definition
5 */
6
7 [ uuid("12345778-1234-abcd-ef00-0123456789ab"),
8   version(0.0),
9   endpoint("ncacn_np:[\\pipe\\lsarpc]","ncacn_np:[\\pipe\\lsass]", "ncacn_ip_tcp:"),
10   pointer_default(unique),
11   helpstring("Local Server Authentication(?)"),
12   depends(security)
13 ] interface lsarpc
14 {
15         /******************/
16         /* Function: 0x00 */
17         NTSTATUS lsa_Close (
18                 [in,out,ref]     policy_handle *handle
19                 );
20         
21
22         /******************/
23         /* Function: 0x01 */
24         NTSTATUS lsa_Delete (
25                 [in,ref]     policy_handle *handle
26                 );
27
28
29         /******************/
30         /* Function: 0x02 */
31
32         typedef struct {
33                 [value(2*strlen_m(r->name))] uint16 name_len;
34                 [value(r->name_len)] uint16 name_size;
35                 unistr_noterm *name;
36         } lsa_Name;
37
38         typedef struct {
39                 lsa_Name name;
40                 uint32 luid_low;
41                 uint32 luid_high;
42         } lsa_PrivEntry;
43
44         typedef struct {
45                 uint32 count;
46                 [size_is(count)] lsa_PrivEntry *privs;
47         } lsa_PrivArray;
48
49         NTSTATUS lsa_EnumPrivs (
50                 [in,ref]     policy_handle *handle,
51                 [in,out,ref] uint32 *resume_handle,
52                 [in]         uint32 max_count,
53                 [out,ref]    lsa_PrivArray *privs
54                 );
55
56         /******************/
57         /* Function: 0x03 */
58
59         NTSTATUS lsa_QuerySecurity (
60                 [in,ref]     policy_handle *handle,
61                 [in]         uint32 sec_info,
62                 [out]        sec_desc_buf *sdbuf
63                 );
64
65
66         /******************/
67         /* Function: 0x04 */
68         NTSTATUS lsa_SetSecObj ();
69
70
71         /******************/
72         /* Function: 0x05 */
73         NTSTATUS lsa_ChangePassword ();
74
75
76         /******************/
77         /* Function: 0x06 */
78         typedef struct {
79                 uint32  len; /* ignored */
80                 uint16  impersonation_level;
81                 uint8   context_mode;
82                 uint8   effective_only;
83         } lsa_QosInfo;
84         
85         typedef struct {
86                 uint32 len; /* ignored */
87                 uint8 *root_dir;
88                 unistr *object_name;
89                 uint32 attributes;
90                 security_descriptor *sec_desc;
91                 lsa_QosInfo *sec_qos;
92         } lsa_ObjectAttribute;
93
94         /* notice the screwup with the system_name - thats why MS created
95            OpenPolicy2 */
96         NTSTATUS lsa_OpenPolicy (
97                 [in]       uint16 *system_name,
98                 [in,ref]   lsa_ObjectAttribute *attr,
99                 [in]       uint32 access_mask,
100                 [out,ref]  policy_handle *handle
101                 );
102         
103
104
105         /******************/
106         /* Function: 0x07 */
107
108         typedef struct {
109                 uint32 percent_full;
110                 uint32 log_size;
111                 NTTIME retention_time;
112                 uint8  shutdown_in_progress;
113                 NTTIME time_to_shutdown;
114                 uint32 next_audit_record;
115                 uint32 unknown;
116         } lsa_AuditLogInfo;
117
118         typedef struct {
119                 uint32 auditing_mode;
120                 [size_is(count)] uint32 *settings;
121                 uint32 count;
122         } lsa_AuditEventsInfo;
123
124         typedef struct {
125                 lsa_Name name;
126                 dom_sid2 *sid;
127         } lsa_DomainInfo;
128
129         typedef struct {
130                 lsa_Name name;
131         } lsa_PDAccountInfo;
132
133         typedef struct {
134                 uint16 unknown; /* an midl padding bug? */
135                 uint16 role;
136         } lsa_ServerRole;
137
138         typedef struct {
139                 lsa_Name source;
140                 lsa_Name account;
141         } lsa_ReplicaSourceInfo;
142
143         typedef struct {
144                 uint32 paged_pool;
145                 uint32 non_paged_pool;
146                 uint32 min_wss;
147                 uint32 max_wss;
148                 uint32 pagefile;
149                 HYPER_T unknown;
150         } lsa_DefaultQuotaInfo;
151
152         typedef struct {
153                 HYPER_T modified_id;
154                 NTTIME db_create_time;
155         } lsa_ModificationInfo;
156
157         typedef struct {
158                 uint8 shutdown_on_full;
159         } lsa_AuditFullSetInfo;
160
161         typedef struct {
162                 uint16 unknown; /* an midl padding bug? */
163                 uint8 shutdown_on_full;
164                 uint8 log_is_full;
165         } lsa_AuditFullQueryInfo;
166
167         typedef struct {
168                 lsa_Name name;
169                 lsa_Name dns_domain;
170                 lsa_Name dns_forest;
171                 GUID domain_guid;
172                 dom_sid2 *sid;
173         } lsa_DnsDomainInfo;
174
175         typedef enum {
176                 LSA_POLICY_INFO_AUDIT_LOG=1,
177                 LSA_POLICY_INFO_AUDIT_EVENTS=2,
178                 LSA_POLICY_INFO_DOMAIN=3,
179                 LSA_POLICY_INFO_PD=4,
180                 LSA_POLICY_INFO_ACCOUNT_DOMAIN=5,
181                 LSA_POLICY_INFO_ROLE=6,
182                 LSA_POLICY_INFO_REPLICA=7,
183                 LSA_POLICY_INFO_QUOTA=8,
184                 LSA_POLICY_INFO_DB=9,
185                 LSA_POLICY_INFO_AUDIT_FULL_SET=10,
186                 LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
187                 LSA_POLICY_INFO_DNS=12
188         } lsaPolicyInfo;
189
190         typedef union {
191                 [case(LSA_POLICY_INFO_AUDIT_LOG)]        lsa_AuditLogInfo       audit_log;
192                 [case(LSA_POLICY_INFO_AUDIT_EVENTS)]     lsa_AuditEventsInfo    audit_events;
193                 [case(LSA_POLICY_INFO_DOMAIN)]           lsa_DomainInfo         domain;
194                 [case(LSA_POLICY_INFO_PD)]               lsa_PDAccountInfo      pd;
195                 [case(LSA_POLICY_INFO_ACCOUNT_DOMAIN)]   lsa_DomainInfo         account_domain;
196                 [case(LSA_POLICY_INFO_ROLE)]             lsa_ServerRole         role;
197                 [case(LSA_POLICY_INFO_REPLICA)]          lsa_ReplicaSourceInfo  replica;
198                 [case(LSA_POLICY_INFO_QUOTA)]            lsa_DefaultQuotaInfo   quota;
199                 [case(LSA_POLICY_INFO_DB)]               lsa_ModificationInfo   db;
200                 [case(LSA_POLICY_INFO_AUDIT_FULL_SET)]   lsa_AuditFullSetInfo   auditfullset;
201                 [case(LSA_POLICY_INFO_AUDIT_FULL_QUERY)] lsa_AuditFullQueryInfo auditfullquery;
202                 [case(LSA_POLICY_INFO_DNS)]              lsa_DnsDomainInfo      dns;
203         } lsa_PolicyInformation;
204
205         NTSTATUS lsa_QueryInfoPolicy (
206                 [in,ref]                 policy_handle *handle,
207                 [in]                     uint16 level,
208                 [out,switch_is(level)]   lsa_PolicyInformation *info
209                 );
210
211         /******************/
212         /* Function:       0x08 */
213         NTSTATUS lsa_SetInfoPolicy ();
214
215         /******************/
216         /* Function:       0x09 */
217         NTSTATUS lsa_ClearAuditLog ();
218
219         /******************/
220         /* Function: 0x0a */
221         NTSTATUS lsa_CreateAccount (
222                 [in,ref]    policy_handle *handle,
223                 [in,ref]    dom_sid2 *sid,
224                 [in]        uint32 access_mask,
225                 [out,ref]   policy_handle *acct_handle
226                 );
227
228         /******************/
229         /* Function: 0x0b */
230         typedef struct {
231                 dom_sid2 *sid;
232         } lsa_SidPtr;
233         
234         typedef [public] struct {
235                 [range(0,1000)] uint32 num_sids;
236                 [size_is(num_sids)] lsa_SidPtr *sids;
237         } lsa_SidArray;
238
239         NTSTATUS lsa_EnumAccounts (
240                 [in,ref]     policy_handle *handle,
241                 [in,out,ref] uint32 *resume_handle,
242                 [in,range(0,1000)] uint32 num_entries,
243                 [out,ref]    lsa_SidArray *sids
244                 );
245
246
247         /*************************************************/
248         /* Function: 0x0c                                */
249
250         typedef struct {
251                 lsa_Name name;
252                 dom_sid2 *sid;
253         } lsa_TrustInformation;
254
255         NTSTATUS lsa_CreateTrustedDomain(
256                 [in,ref]     policy_handle *handle,
257                 [in,ref]     lsa_TrustInformation *info,
258                 [in]         uint32 access_mask,
259                 [out,ref]    policy_handle *dom_handle
260                 );
261
262
263         /******************/
264         /* Function: 0x0d */
265
266         typedef struct {
267                 lsa_Name name;
268                 dom_sid2 *sid;
269         } lsa_DomainInformation;
270
271         typedef struct {
272                 uint32 count;
273                 [size_is(count)] lsa_DomainInformation *domains;
274         } lsa_DomainList;
275
276         NTSTATUS lsa_EnumTrustDom (
277                 [in,ref]     policy_handle *handle,
278                 [in,out,ref] uint32 *resume_handle,
279                 [in,range(0,1000)] uint32 num_entries,
280                 [out,ref]    lsa_DomainList *domains
281                 );
282
283
284         /******************/
285         /* Function: 0x0e */
286
287         typedef struct {
288                 uint16 sid_type;
289                 uint32 rid;
290                 uint32 sid_index;
291         } lsa_TranslatedSid;
292
293         typedef struct {
294                 [range(0,1000)] uint32 count;
295                 [size_is(count)] lsa_TranslatedSid *sids;
296         } lsa_TransSidArray;
297
298         typedef struct {
299                 [range(0,1000)] uint32 count;
300                 [size_is(count)] lsa_TrustInformation *domains;
301                 uint32 max_count;
302         } lsa_RefDomainList;
303
304         NTSTATUS lsa_LookupNames (
305                 [in,ref]     policy_handle *handle,
306                 [in,range(0,1000)] uint32 num_names,
307                 [in,ref,size_is(num_names)]  lsa_Name *names,
308                 [out]        lsa_RefDomainList *domains,
309                 [in,out,ref] lsa_TransSidArray *sids,
310                 [in]         uint16 level,
311                 [in,out,ref] uint32 *count
312                 );
313
314
315         /******************/
316         /* Function: 0x0f */
317
318         typedef struct {
319                 uint16 sid_type;
320                 lsa_Name name;
321                 uint32 sid_index;
322         } lsa_TranslatedName;
323
324         typedef struct {
325                 [range(0,1000)] uint32 count;
326                 [size_is(count)] lsa_TranslatedName *names;
327         } lsa_TransNameArray;
328
329         NTSTATUS lsa_LookupSids (
330                 [in,ref]     policy_handle *handle,
331                 [in,ref]     lsa_SidArray *sids,
332                 [out]        lsa_RefDomainList *domains,
333                 [in,out,ref] lsa_TransNameArray *names,
334                 [in]         uint16 level,
335                 [in,out,ref] uint32 *count
336                 );
337
338
339         /* Function:        0x10 */
340         NTSTATUS lsa_CreateSecret(
341                 [in,ref]     policy_handle *handle,
342                 [in]         lsa_Name       name,
343                 [in]         uint32         access_mask,
344                 [out,ref]    policy_handle *sec_handle
345                 );
346
347
348         /*****************************************/
349         /* Function:     0x11                    */
350         NTSTATUS lsa_OpenAccount (
351                 [in,ref]     policy_handle *handle,
352                 [in,ref]     dom_sid2 *sid,
353                 [in]         uint32 access_mask,
354                 [out,ref]    policy_handle *acct_handle
355                 );
356
357
358         /****************************************/
359         /* Function:    0x12                    */
360
361         typedef struct {
362                 uint32 low;
363                 uint32 high;
364         } lsa_LUID;
365         
366         typedef struct {
367                 lsa_LUID luid;
368                 uint32 attribute;
369         } lsa_LUIDAttribute;
370         
371         typedef struct {
372                 uint32 count;
373                 uint32 unknown;
374                 [size_is(count)] lsa_LUIDAttribute set[*];
375         } lsa_PrivilegeSet;
376         
377         NTSTATUS lsa_EnumPrivsAccount (
378                 [in,ref]     policy_handle *handle,
379                 [out]        lsa_PrivilegeSet *privs
380                 );
381
382
383         /* Function:            0x13 */
384         NTSTATUS lsa_AddPrivilegesToAccount();
385         
386         /* Function:         0x14 */
387         NTSTATUS lsa_RemovePrivilegesFromAccount();
388
389         /* Function:           0x15 */
390         NTSTATUS lsa_GetQuotasForAccount();
391         
392         /* Function:           0x16 */
393         NTSTATUS lsa_SetQuotasForAccount();
394         
395         /* Function:    0x17 */
396         NTSTATUS lsa_GetSystemAccessAccount();
397         /* Function:    0x18 */
398         NTSTATUS lsa_SetSystemAccessAccount();
399
400         /* Function:        0x19 */
401         NTSTATUS lsa_OpenTrustedDomain(
402                 [in,ref]     policy_handle *handle,
403                 [in,ref]     dom_sid2      *sid,
404                 [in]         uint32         access_mask,
405                 [out,ref]    policy_handle *trustdom_handle
406                 );
407
408         /* Function:       0x1a */
409         NTSTATUS lsa_QueryInfoTrustedDomain();
410         /* Function:     0x1b */
411         NTSTATUS lsa_SetInformationTrustedDomain();
412
413         /* Function:          0x1c */
414         NTSTATUS lsa_OpenSecret(
415                 [in,ref]     policy_handle *handle,
416                 [in]         lsa_Name       name,
417                 [in]         uint32         access_mask,
418                 [out,ref]    policy_handle *sec_handle
419                 );
420
421         /* Function:           0x1d */
422         typedef [flag(NDR_PAHEX)] struct {
423                 uint32 length;
424                 uint32 size;
425                 [size_is(size),length_is(length)] uint8 *data;
426         } lsa_DATA_BUF;
427
428         NTSTATUS lsa_SetSecret(
429                 [in,ref]     policy_handle *handle,
430                 [in]         lsa_DATA_BUF     *new_val,
431                 [in]         lsa_DATA_BUF     *old_val
432                 );
433
434         typedef struct {
435                 lsa_DATA_BUF *buf;
436         } lsa_DATA_BUF_PTR;
437
438         /* Function:         0x1e */
439         NTSTATUS lsa_QuerySecret (
440                 [in,ref]     policy_handle *handle,
441                 [in,out]     lsa_DATA_BUF_PTR  *new_val,
442                 [in,out]     NTTIME            *new_mtime,
443                 [in,out]     lsa_DATA_BUF_PTR  *old_val,
444                 [in,out]     NTTIME            *old_mtime
445                 );
446
447         /* Function:     0x1f */
448         NTSTATUS lsa_LookupPrivValue();
449
450
451         /* Function:      0x20 */
452         NTSTATUS lsa_LookupPrivName (
453                 [in,ref]     policy_handle *handle,
454                 [in,ref]     lsa_LUID *luid,
455                 [out]        lsa_Name *name
456                 );
457
458
459         /*******************/
460         /* Function:  0x21 */
461         NTSTATUS lsa_LookupPrivDisplayName (
462                 [in,ref]     policy_handle *handle,
463                 [in,ref]     lsa_Name *name,
464                 [out]        lsa_Name *disp_name,
465                 /* see http://www.microsoft.com/globaldev/nlsweb/ for
466                    language definitions */
467                 [in,out,ref] uint16 *language_id,
468                 [in]         uint16 unknown
469                 );
470
471         /* Function:        0x22 */
472         NTSTATUS lsa_DeleteObject();
473
474         
475         /*******************/
476         /* Function:      0x23 */
477         NTSTATUS lsa_EnumAccountsWithUserRight (
478                 [in,ref]     policy_handle *handle,
479                 [in]         lsa_Name *name,
480                 [out,ref]    lsa_SidArray *sids
481                 );
482
483         /* Function:      0x24 */
484         typedef struct {
485                 unistr *name;
486         } lsa_RightAttribute;
487         
488         typedef struct {
489                 uint32 count;
490                 [size_is(count)] lsa_Name *names;
491         } lsa_RightSet;
492         
493         NTSTATUS lsa_EnumAccountRights (
494                 [in,ref]     policy_handle *handle,
495                 [in,ref]     dom_sid2 *sid,
496                 [out,ref]    lsa_RightSet *rights
497                 );
498
499
500         /**********************/
501         /* Function:       0x25 */
502         NTSTATUS lsa_AddAccountRights (
503                 [in,ref]     policy_handle *handle,
504                 [in,ref]     dom_sid2 *sid,
505                 [in,ref]     lsa_RightSet *rights
506                 );
507         
508         /**********************/
509         /* Function:       0x26 */
510         NTSTATUS lsa_RemoveAccountRights (
511                 [in,ref]     policy_handle *handle,
512                 [in,ref]     dom_sid2 *sid,
513                 [in]         uint32 unknown,
514                 [in,ref]     lsa_RightSet *rights
515                 );
516
517         /* Function:   0x27 */
518         NTSTATUS lsa_QueryTrustDomainInfo();
519         /* Function:     0x28 */
520         NTSTATUS lsa_SetTrustDomainInfo();
521         /* Function:      0x29 */
522         NTSTATUS lsa_DeleteTrustDomain();
523         /* Function:       0x2a */
524         NTSTATUS lsa_StorePrivateData();
525         /* Function:        0x2b */
526         NTSTATUS lsa_RetrievePrivateData();
527
528
529         /**********************/
530         /* Function:     0x2c */
531         NTSTATUS lsa_OpenPolicy2 (
532                 [in]      unistr *system_name,
533                 [in,ref]  lsa_ObjectAttribute *attr,
534                 [in]      uint32 access_mask,
535                 [out,ref] policy_handle *handle
536                 );
537
538
539         /* Function:    0x2d */
540         NTSTATUS lsa_GetUserName();
541
542         /**********************/
543         /* Function:          0x2e */
544
545         NTSTATUS lsa_QueryInfoPolicy2(
546                 [in,ref]                 policy_handle *handle,
547                 [in]                     uint16 level,
548                 [out,switch_is(level)]   lsa_PolicyInformation *info
549                 );
550
551         /* Function 0x2f */
552         NTSTATUS lsa_SetInfoPolicy2();
553
554         /* Function 0x30 */
555         NTSTATUS lsa_QueryTrustedDomainInfoByName();
556
557         /* Function 0x31 */
558         NTSTATUS lsa_SetTrustedDomainInfoByName();
559
560         /* Function 0x32 */
561         NTSTATUS lsa_EnumTrustedDomainsEx();
562
563         /* Function 0x33 */
564         NTSTATUS lsa_CreateTrustedDomainEx();
565
566         /* Function 0x34 */
567         NTSTATUS lsa_CloseTrustedDomainEx();
568
569         /* Function 0x35 */
570         NTSTATUS lsa_QueryDomainInformationPolicy();
571
572         /* Function 0x36 */
573         NTSTATUS lsa_SetDomInfoPolicy();
574
575         /* Function 0x37 */
576         NTSTATUS lsa_OpenTrustedDomainByName(
577                 [in,ref]     policy_handle *handle,
578                 [in]         lsa_Name       name,
579                 [in]         uint32         access_mask,
580                 [out,ref]    policy_handle *trustdom_handle
581                 );
582
583         /* Function 0x38 */
584         NTSTATUS lsa_TestCall();
585
586         /* Function 0x39 */
587         NTSTATUS lsa_LookupSids2();
588
589         /* Function 0x3a */
590         NTSTATUS lsa_LookupNames2();
591
592         /* Function 0x3b */
593         NTSTATUS lsa_CreateTrustedDomainEx2();
594 }