r101: added lsa_SetSecret() and lsa_QuerySecret()
[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   endpoints(lsarpc,lsass),
10   pointer_default(unique)
11 ] interface lsarpc
12 {
13         /******************/
14         /* Function: 0x00 */
15         NTSTATUS lsa_Close (
16                 [in,out,ref]     policy_handle *handle
17                 );
18         
19
20         /******************/
21         /* Function: 0x01 */
22         NTSTATUS lsa_Delete (
23                 [in,ref]     policy_handle *handle
24                 );
25
26
27         /******************/
28         /* Function: 0x02 */
29
30         typedef struct {
31                 [value(2*strlen_m(r->name))] uint16 name_len;
32                 [value(r->name_len)] uint16 name_size;
33                 unistr_noterm *name;
34         } lsa_Name;
35
36         typedef struct {
37                 lsa_Name name;
38                 uint32 luid_low;
39                 uint32 luid_high;
40         } lsa_PrivEntry;
41
42         typedef struct {
43                 uint32 count;
44                 [size_is(count)] lsa_PrivEntry *privs;
45         } lsa_PrivArray;
46
47         NTSTATUS lsa_EnumPrivs (
48                 [in,ref]     policy_handle *handle,
49                 [in,out,ref] uint32 *resume_handle,
50                 [in]         uint32 max_count,
51                 [out,ref]    lsa_PrivArray *privs
52                 );
53
54         /******************/
55         /* Function: 0x03 */
56
57         typedef [public] struct {
58                 uint32 size;
59                 [subcontext(4)] security_descriptor *sd;
60         } sec_desc_buf;
61
62         NTSTATUS lsa_QuerySecObj (
63                 [in,ref]     policy_handle *handle,
64                 [in]         uint32 sec_info,
65                 [out]        sec_desc_buf *sd
66                 );
67
68
69         /******************/
70         /* Function: 0x04 */
71         NTSTATUS lsa_SetSecObj ();
72
73
74         /******************/
75         /* Function: 0x05 */
76         NTSTATUS lsa_ChangePassword ();
77
78
79         /******************/
80         /* Function: 0x06 */
81         typedef struct {
82                 uint32  len; /* ignored */
83                 uint16  impersonation_level;
84                 uint8   context_mode;
85                 uint8   effective_only;
86         } lsa_QosInfo;
87         
88         typedef struct {
89                 uint32 len; /* ignored */
90                 uint8 *root_dir;
91                 unistr *object_name;
92                 uint32 attributes;
93                 security_descriptor *sec_desc;
94                 lsa_QosInfo *sec_qos;
95         } lsa_ObjectAttribute;
96
97         /* notice the screwup with the system_name - thats why MS created
98            OpenPolicy2 */
99         NTSTATUS lsa_OpenPolicy (
100                 [in]       uint16 *system_name,
101                 [in,ref]   lsa_ObjectAttribute *attr,
102                 [in]       uint32 desired_access,
103                 [out,ref]  policy_handle *handle
104                 );
105         
106
107
108         /******************/
109         /* Function: 0x07 */
110
111         typedef struct {
112                 uint32 percent_full;
113                 uint32 log_size;
114                 NTTIME retention_time;
115                 uint8  shutdown_in_progress;
116                 NTTIME time_to_shutdown;
117                 uint32 next_audit_record;
118                 uint32 unknown;
119         } lsa_AuditLogInfo;
120
121         typedef struct {
122                 uint32 auditing_mode;
123                 [size_is(count)] uint32 *settings;
124                 uint32 count;
125         } lsa_AuditEventsInfo;
126
127         typedef struct {
128                 lsa_Name name;
129                 dom_sid2 *sid;
130         } lsa_DomainInfo;
131
132         typedef struct {
133                 lsa_Name name;
134         } lsa_PDAccountInfo;
135
136         typedef struct {
137                 uint16 unknown; /* an midl padding bug? */
138                 uint16 role;
139         } lsa_ServerRole;
140
141         typedef struct {
142                 lsa_Name source;
143                 lsa_Name account;
144         } lsa_ReplicaSourceInfo;
145
146         typedef struct {
147                 uint32 paged_pool;
148                 uint32 non_paged_pool;
149                 uint32 min_wss;
150                 uint32 max_wss;
151                 uint32 pagefile;
152                 HYPER_T unknown;
153         } lsa_DefaultQuotaInfo;
154
155         typedef struct {
156                 HYPER_T modified_id;
157                 NTTIME db_create_time;
158         } lsa_ModificationInfo;
159
160         typedef struct {
161                 uint8 shutdown_on_full;
162         } lsa_AuditFullSetInfo;
163
164         typedef struct {
165                 uint16 unknown; /* an midl padding bug? */
166                 uint8 shutdown_on_full;
167                 uint8 log_is_full;
168         } lsa_AuditFullQueryInfo;
169
170         typedef struct {
171                 lsa_Name name;
172                 lsa_Name dns_domain;
173                 lsa_Name dns_forest;
174                 GUID domain_guid;
175                 dom_sid2 *sid;
176         } lsa_DnsDomainInfo;
177
178         typedef enum {
179                 LSA_POLICY_INFO_AUDIT_LOG=1,
180                 LSA_POLICY_INFO_AUDIT_EVENTS=2,
181                 LSA_POLICY_INFO_DOMAIN=3,
182                 LSA_POLICY_INFO_PD=4,
183                 LSA_POLICY_INFO_ACCOUNT_DOMAIN=5,
184                 LSA_POLICY_INFO_ROLE=6,
185                 LSA_POLICY_INFO_REPLICA=7,
186                 LSA_POLICY_INFO_QUOTA=8,
187                 LSA_POLICY_INFO_DB=9,
188                 LSA_POLICY_INFO_AUDIT_FULL_SET=10,
189                 LSA_POLICY_INFO_AUDIT_FULL_QUERY=11,
190                 LSA_POLICY_INFO_DNS=12
191         } lsaPolicyInfo;
192
193         typedef union {
194                 [case(1)]  lsa_AuditLogInfo audit_log;
195                 [case(2)]  lsa_AuditEventsInfo audit_events;
196                 [case(3)]  lsa_DomainInfo domain;
197                 [case(4)]  lsa_PDAccountInfo pd;
198                 [case(5)]  lsa_DomainInfo account_domain;
199                 [case(6)]  lsa_ServerRole role;
200                 [case(7)]  lsa_ReplicaSourceInfo replica;
201                 [case(8)]  lsa_DefaultQuotaInfo quota;
202                 [case(9)]  lsa_ModificationInfo db;
203                 [case(10)] lsa_AuditFullSetInfo auditfullset;
204                 [case(11)] lsa_AuditFullQueryInfo auditfullquery;
205                 [case(12)] lsa_DnsDomainInfo dns;
206         } lsa_PolicyInformation;
207
208         NTSTATUS lsa_QueryInfoPolicy (
209                 [in,ref]                 policy_handle *handle,
210                 [in]                     uint16 level,
211                 [out,switch_is(level)]   lsa_PolicyInformation *info
212                 );
213
214         /******************/
215         /* Function:       0x08 */
216         NTSTATUS lsa_SetInfoPolicy ();
217
218         /******************/
219         /* Function:       0x09 */
220         NTSTATUS lsa_ClearAuditLog ();
221
222         /******************/
223         /* Function: 0x0a */
224         NTSTATUS lsa_CreateAccount (
225                 [in,ref]    policy_handle *handle,
226                 [in,ref]    dom_sid2 *sid,
227                 [in]        uint32 desired_access,
228                 [out,ref]   policy_handle *acct_handle
229                 );
230
231         /******************/
232         /* Function: 0x0b */
233         typedef struct {
234                 dom_sid2 *sid;
235         } lsa_SidPtr;
236         
237         typedef [public] struct {
238                 uint32 num_sids;
239                 [size_is(num_sids)] lsa_SidPtr *sids;
240         } lsa_SidArray;
241
242         NTSTATUS lsa_EnumAccounts (
243                 [in,ref]     policy_handle *handle,
244                 [in,out,ref] uint32 *resume_handle,
245                 [in]         uint32 num_entries,
246                 [out,ref]    lsa_SidArray *sids
247                 );
248
249
250         /*************************************************/
251         /* Function: 0x0c                                */
252
253         typedef struct {
254                 lsa_Name name;
255                 dom_sid2 *sid;
256         } lsa_TrustInformation;
257
258         NTSTATUS lsa_CreateTrustedDomain(
259                 [in,ref]     policy_handle *handle,
260                 [in,ref]     lsa_TrustInformation *info,
261                 [in]         uint32 desired_access,
262                 [out,ref]    policy_handle *dom_handle
263                 );
264
265
266         /******************/
267         /* Function: 0x0d */
268
269         typedef struct {
270                 lsa_Name name;
271                 dom_sid2 *sid;
272         } lsa_DomainInformation;
273
274         typedef struct {
275                 uint32 count;
276                 [size_is(count)] lsa_DomainInformation *domains;
277         } lsa_DomainList;
278
279         NTSTATUS lsa_EnumTrustDom (
280                 [in,ref]     policy_handle *handle,
281                 [in,out,ref] uint32 *resume_handle,
282                 [in]         uint32 num_entries,
283                 [out,ref]    lsa_DomainList *domains
284                 );
285
286
287         /******************/
288         /* Function: 0x0e */
289
290         typedef struct {
291                 uint16 sid_type;
292                 uint32 rid;
293                 uint32 sid_index;
294         } lsa_TranslatedSid;
295
296         typedef struct {
297                 uint32 count;
298                 [size_is(count)] lsa_TranslatedSid *sids;
299         } lsa_TransSidArray;
300
301         typedef struct {
302                 uint32 count;
303                 [size_is(count)] lsa_TrustInformation *domains;
304                 uint32 max_count;
305         } lsa_RefDomainList;
306
307         NTSTATUS lsa_LookupNames (
308                 [in,ref]     policy_handle *handle,
309                 [in]         uint32 num_names,
310                 [in,ref,size_is(num_names)]  lsa_Name *names,
311                 [out]        lsa_RefDomainList *domains,
312                 [in,out,ref] lsa_TransSidArray *sids,
313                 [in]         uint16 level,
314                 [in,out,ref] uint32 *count
315                 );
316
317
318         /******************/
319         /* Function: 0x0f */
320
321         typedef struct {
322                 uint16 sid_type;
323                 lsa_Name name;
324                 uint32 sid_index;
325         } lsa_TranslatedName;
326
327         typedef struct {
328                 uint32 count;
329                 [size_is(count)] lsa_TranslatedName *names;
330         } lsa_TransNameArray;
331
332         NTSTATUS lsa_LookupSids (
333                 [in,ref]     policy_handle *handle,
334                 [in,ref]     lsa_SidArray *sids,
335                 [out]        lsa_RefDomainList *domains,
336                 [in,out,ref] lsa_TransNameArray *names,
337                 [in]         uint16 level,
338                 [in,out,ref] uint32 *count
339                 );
340
341
342         /* Function:        0x10 */
343         NTSTATUS lsa_CreateSecret(
344                 [in,ref]     policy_handle *handle,
345                 [in]         lsa_Name       name,
346                 [in]         uint32         desired_access,
347                 [out,ref]    policy_handle *sec_handle
348                 );
349
350
351         /*****************************************/
352         /* Function:     0x11                    */
353         NTSTATUS lsa_OpenAccount (
354                 [in,ref]     policy_handle *handle,
355                 [in,ref]     dom_sid2 *sid,
356                 [in]         uint32 desired_access,
357                 [out,ref]    policy_handle *acct_handle
358                 );
359
360
361         /****************************************/
362         /* Function:    0x12                    */
363
364         typedef struct {
365                 uint32 low;
366                 uint32 high;
367         } lsa_LUID;
368         
369         typedef struct {
370                 lsa_LUID luid;
371                 uint32 attribute;
372         } lsa_LUIDAttribute;
373         
374         typedef struct {
375                 uint32 count;
376                 uint32 unknown;
377                 [size_is(count)] lsa_LUIDAttribute set[*];
378         } lsa_PrivilegeSet;
379         
380         NTSTATUS lsa_EnumPrivsAccount (
381                 [in,ref]     policy_handle *handle,
382                 [out]        lsa_PrivilegeSet *privs
383                 );
384
385
386         /* Function:            0x13 */
387         NTSTATUS ADDPRIVS ();
388         /* Function:         0x14 */
389         NTSTATUS REMOVEPRIVS ();
390         /* Function:           0x15 */
391         NTSTATUS GETQUOTAS ();
392         /* Function:           0x16 */
393         NTSTATUS SETQUOTAS ();
394         /* Function:    0x17 */
395         NTSTATUS GETSYSTEMACCOUNT ();
396         /* Function:    0x18 */
397         NTSTATUS SETSYSTEMACCOUNT ();
398         /* Function:        0x19 */
399         NTSTATUS OPENTRUSTDOM ();
400         /* Function:       0x1a */
401         NTSTATUS QUERYTRUSTDOM ();
402         /* Function:     0x1b */
403         NTSTATUS SETINFOTRUSTDOM ();
404
405         /* Function:          0x1c */
406         NTSTATUS lsa_OpenSecret(
407                 [in,ref]     policy_handle *handle,
408                 [in]         lsa_Name       name,
409                 [in]         uint32         desired_access,
410                 [out,ref]    policy_handle *sec_handle
411                 );
412
413         /* Function:           0x1d */
414         typedef [flag(NDR_PAHEX)] struct {
415                 uint32 length;
416                 uint32 size;
417                 [size_is(size),length_is(length)] uint8 *data;
418         } lsa_DATA_BUF;
419
420         NTSTATUS lsa_SetSecret(
421                 [in,ref]     policy_handle *handle,
422                 [in]         lsa_DATA_BUF     *new_val,
423                 [in]         lsa_DATA_BUF     *old_val
424                 );
425
426         typedef struct {
427                 lsa_DATA_BUF *buf;
428         } lsa_DATA_BUF_PTR;
429
430         /* Function:         0x1e */
431         NTSTATUS lsa_QuerySecret (
432                 [in,ref]     policy_handle *handle,
433                 [in,out]     lsa_DATA_BUF_PTR  *new_val,
434                 [in,out]     NTTIME            *new_mtime,
435                 [in,out]     lsa_DATA_BUF_PTR  *old_val,
436                 [in,out]     NTTIME            *old_mtime
437                 );
438
439         /* Function:     0x1f */
440         NTSTATUS LOOKUPPRIVVALUE ();
441
442
443         /* Function:      0x20 */
444         NTSTATUS lsa_LookupPrivName (
445                 [in,ref]     policy_handle *handle,
446                 [in,ref]     lsa_LUID *luid,
447                 [out]        lsa_Name *name
448                 );
449
450
451         /* Function:  0x21 */
452         NTSTATUS PRIV_GET_DISPNAME ();
453         /* Function:        0x22 */
454         NTSTATUS DELETEOBJECT ();
455         /* Function:   0x23 */
456         NTSTATUS ENUMACCTWITHRIGHT ();
457
458         /* Function:      0x24 */
459         typedef struct {
460                 unistr *name;
461         } lsa_RightAttribute;
462         
463         typedef struct {
464                 uint32 count;
465                 [size_is(count)] lsa_Name *names;
466         } lsa_RightSet;
467         
468         NTSTATUS lsa_EnumAccountRights (
469                 [in,ref]     policy_handle *handle,
470                 [in,ref]     dom_sid2 *sid,
471                 [out,ref]    lsa_RightSet *rights
472                 );
473
474
475         /* Function:       0x25 */
476         NTSTATUS ADDACCTRIGHTS ();
477         /* Function:    0x26 */
478         NTSTATUS REMOVEACCTRIGHTS ();
479         /* Function:   0x27 */
480         NTSTATUS QUERYTRUSTDOMINFO ();
481         /* Function:     0x28 */
482         NTSTATUS SETTRUSTDOMINFO ();
483         /* Function:      0x29 */
484         NTSTATUS DELETETRUSTDOM ();
485         /* Function:       0x2a */
486         NTSTATUS STOREPRIVDATA ();
487         /* Function:        0x2b */
488         NTSTATUS RETRPRIVDATA ();
489
490
491         /**********************/
492         /* Function:     0x2c */
493         NTSTATUS lsa_OpenPolicy2 (
494                 [in]      unistr *system_name,
495                 [in,ref]  lsa_ObjectAttribute *attr,
496                 [in]      uint32 desired_access,
497                 [out,ref] policy_handle *handle
498                 );
499
500
501         /* Function:    0x2d */
502         NTSTATUS UNK_GET_CONNUSER ();
503         /* Function:          0x2e */
504         NTSTATUS QUERYINFO2 ();
505 }
506
507
508
509   uuid(3919286a-b10c-11d0-9ba8-00c04fd92ef5),
510   version(0.0),
511   endpoints(lsarpc,lsass),
512   pointer_default(unique)
513
514 interface lsads
515 {
516
517         /*****************/
518         /* Function 0x00 */
519         void lsads_Unknown0();
520
521 }