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