added idl and test code for lsa_LookupPrivName()
[samba.git] / source / librpc / idl / lsa.idl
1 /*
2   lsa interface definition
3 */
4
5 [ uuid(12345778-1234-abcd-ef00-0123456789ab),
6   version(0.0),
7   pointer_default(unique)
8 ] interface lsarpc
9 {
10         /******************/
11         /* Function: 0x00 */
12         NTSTATUS lsa_Close (
13                 [in,out,ref]     policy_handle *handle
14                 );
15         
16
17         /******************/
18         /* Function: 0x01 */
19         NTSTATUS lsa_Delete (
20                 [in,ref]     policy_handle *handle
21                 );
22
23
24         /******************/
25         /* Function: 0x02 */
26
27         typedef struct {
28                 uint16 name_len;
29                 uint16 name_size;
30                 unistr_noterm *name;
31         } lsa_Name;
32
33         typedef struct {
34                 lsa_Name name;
35                 uint32 luid_low;
36                 uint32 luid_high;
37         } lsa_PrivEntry;
38
39         typedef struct {
40                 uint32 count;
41                 [size_is(count)] lsa_PrivEntry *privs;
42         } lsa_PrivArray;
43
44         NTSTATUS lsa_EnumPrivs (
45                 [in,ref]     policy_handle *handle,
46                 [in,out,ref] uint32 *resume_handle,
47                 [in]         uint32 max_count,
48                 [out,ref]    lsa_PrivArray *privs
49                 );
50
51
52         /******************/
53         /* Function: 0x03 */
54         NTSTATUS lsa_QuerySecObj ();
55
56
57         /******************/
58         /* Function: 0x04 */
59         NTSTATUS lsa_SetSecObj ();
60
61
62         /******************/
63         /* Function: 0x05 */
64         NTSTATUS lsa_ChangePassword ();
65
66
67         /******************/
68         /* Function: 0x06 */
69         typedef struct {
70                 [struct_len] uint32 _len;
71                 uint16  impersonation_level;
72                 uint8   context_mode;
73                 uint8   effective_only;
74         } lsa_QosInfo;
75         
76         typedef struct {
77                 [struct_len] uint32 _len;
78                 uint8 *root_dir;
79                 unistr *object_name;
80                 uint32 attributes;
81                 security_descriptor *sec_desc;
82                 lsa_QosInfo *sec_qos;
83         } lsa_ObjectAttribute;
84
85         /* notice the screwup with the system_name - thats why MS created
86            OpenPolicy2 */
87         NTSTATUS lsa_OpenPolicy (
88                 [in]       uint16 *system_name,
89                 [in,ref]   lsa_ObjectAttribute *attr,
90                 [in]       uint32 desired_access,
91                 [out,ref]  policy_handle *handle
92                 );
93         
94
95
96         /******************/
97         /* Function: 0x07 */
98         NTSTATUS lsa_QueryInfoPolicy ();
99
100         /******************/
101         /* Function:       0x08 */
102         NTSTATUS lsa_SetInfoPolicy ();
103
104         /******************/
105         /* Function:       0x09 */
106         NTSTATUS lsa_ClearAuditLog ();
107
108         /******************/
109         /* Function: 0x0a */
110         NTSTATUS lsa_CreateAccount ();
111
112
113         /******************/
114         /* Function: 0x0b */
115         typedef struct {
116                 dom_sid2 *sid;
117         } lsa_SidPtr;
118         
119         typedef struct {
120                 uint32 num_sids;
121                 [size_is(num_sids)] lsa_SidPtr *sids;
122         } lsa_SidArray;
123
124         NTSTATUS lsa_EnumAccounts (
125                 [in,ref]     policy_handle *handle,
126                 [in,out,ref] uint32 *resume_handle,
127                 [in]         uint32 num_entries,
128                 [out,ref]    lsa_SidArray *sids
129                 );
130
131
132         /*************************************************/
133         /* Function: 0x0c                                */
134         NTSTATUS lsa_CreateTrustDom ();
135
136
137         /******************/
138         /* Function: 0x0d */
139
140         typedef struct {
141                 lsa_Name name;
142                 dom_sid2 *sid;
143         } lsa_DomainInformation;
144
145         typedef struct {
146                 uint32 count;
147                 [size_is(count)] lsa_DomainInformation *domains;
148         } lsa_DomainList;
149
150         NTSTATUS lsa_EnumTrustDom (
151                 [in,ref]     policy_handle *handle,
152                 [in,out,ref] uint32 *resume_handle,
153                 [in]         uint32 num_entries,
154                 [out,ref]    lsa_DomainList *domains
155                 );
156
157
158         /******************/
159         /* Function: 0x0e */
160
161         typedef struct {
162                 uint16 sid_type;
163                 uint32 rid;
164                 uint32 sid_index;
165         } lsa_TranslatedSid;
166
167         typedef struct {
168                 uint32 count;
169                 [size_is(count)] lsa_TranslatedSid *sids;
170         } lsa_TransSidArray;
171
172         typedef struct {
173                 lsa_Name name;
174                 dom_sid2 *sid;
175         } lsa_TrustInformation;
176
177         typedef struct {
178                 uint32 count;
179                 [size_is(count)] lsa_TrustInformation *domains;
180                 uint32 max_count;
181         } lsa_RefDomainList;
182
183         NTSTATUS lsa_LookupNames (
184                 [in,ref]     policy_handle *handle,
185                 [in]         uint32 num_names,
186                 [in,ref,size_is(num_names)]  lsa_Name *names,
187                 [out]        lsa_RefDomainList *domains,
188                 [in,out,ref] lsa_TransSidArray *sids,
189                 [in]         uint16 level,
190                 [in,out,ref] uint32 *count
191                 );
192
193
194         /******************/
195         /* Function: 0x0f */
196
197         typedef struct {
198                 uint16 sid_type;
199                 lsa_Name name;
200                 uint32 sid_index;
201         } lsa_TranslatedName;
202
203         typedef struct {
204                 uint32 count;
205                 [size_is(count)] lsa_TranslatedName *names;
206         } lsa_TransNameArray;
207
208         NTSTATUS lsa_LookupSids (
209                 [in,ref]     policy_handle *handle,
210                 [in,ref]     lsa_SidArray *sids,
211                 [out]        lsa_RefDomainList *domains,
212                 [in,out,ref] lsa_TransNameArray *names,
213                 [in]         uint16 level,
214                 [in,out,ref] uint32 *count
215                 );
216
217
218         /* Function:        0x10 */
219         NTSTATUS CREATESECRET ();
220
221
222         /*****************************************/
223         /* Function:     0x11                    */
224         NTSTATUS lsa_OpenAccount (
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         /****************************************/
233         /* Function:    0x12                    */
234
235         typedef struct {
236                 uint32 low;
237                 uint32 high;
238         } lsa_LUID;
239         
240         typedef struct {
241                 lsa_LUID luid;
242                 uint32 attribute;
243         } lsa_LUIDAttribute;
244         
245         typedef struct {
246                 uint32 count;
247                 [size_is(count)] lsa_LUIDAttribute set[*];
248         } lsa_PrivilegeSet;
249         
250         NTSTATUS lsa_EnumPrivsAccount (
251                 [in,ref]     policy_handle *handle,
252                 [out]        lsa_PrivilegeSet *privs,
253                 [out]        uint32 unknown
254                 );
255
256
257         /* Function:            0x13 */
258         NTSTATUS ADDPRIVS ();
259         /* Function:         0x14 */
260         NTSTATUS REMOVEPRIVS ();
261         /* Function:           0x15 */
262         NTSTATUS GETQUOTAS ();
263         /* Function:           0x16 */
264         NTSTATUS SETQUOTAS ();
265         /* Function:    0x17 */
266         NTSTATUS GETSYSTEMACCOUNT ();
267         /* Function:    0x18 */
268         NTSTATUS SETSYSTEMACCOUNT ();
269         /* Function:        0x19 */
270         NTSTATUS OPENTRUSTDOM ();
271         /* Function:       0x1a */
272         NTSTATUS QUERYTRUSTDOM ();
273         /* Function:     0x1b */
274         NTSTATUS SETINFOTRUSTDOM ();
275         /* Function:          0x1c */
276         NTSTATUS OPENSECRET ();
277         /* Function:           0x1d */
278         NTSTATUS SETSECRET ();
279         /* Function:         0x1e */
280         NTSTATUS QUERYSECRET ();
281
282         /* Function:     0x1f */
283         NTSTATUS LOOKUPPRIVVALUE ();
284
285
286         /* Function:      0x20 */
287         NTSTATUS lsa_LookupPrivName (
288                 [in,ref]     policy_handle *handle,
289                 [in]         uint32 luid_high,
290                 [in]         uint32 luid_low,
291                 [out]        lsa_Name *name
292                 );
293
294
295         /* Function:  0x21 */
296         NTSTATUS PRIV_GET_DISPNAME ();
297         /* Function:        0x22 */
298         NTSTATUS DELETEOBJECT ();
299         /* Function:   0x23 */
300         NTSTATUS ENUMACCTWITHRIGHT ();
301
302         /* Function:      0x24 */
303         typedef struct {
304                 unistr *name;
305         } lsa_RightAttribute;
306         
307         typedef struct {
308                 uint32 count;
309                 [size_is(count)] lsa_Name *names;
310         } lsa_RightSet;
311         
312         NTSTATUS lsa_EnumAccountRights (
313                 [in,ref]     policy_handle *handle,
314                 [in,ref]     dom_sid2 *sid,
315                 [out,ref]    lsa_RightSet *rights
316                 );
317
318
319         /* Function:       0x25 */
320         NTSTATUS ADDACCTRIGHTS ();
321         /* Function:    0x26 */
322         NTSTATUS REMOVEACCTRIGHTS ();
323         /* Function:   0x27 */
324         NTSTATUS QUERYTRUSTDOMINFO ();
325         /* Function:     0x28 */
326         NTSTATUS SETTRUSTDOMINFO ();
327         /* Function:      0x29 */
328         NTSTATUS DELETETRUSTDOM ();
329         /* Function:       0x2a */
330         NTSTATUS STOREPRIVDATA ();
331         /* Function:        0x2b */
332         NTSTATUS RETRPRIVDATA ();
333
334
335         /**********************/
336         /* Function:     0x2c */
337         NTSTATUS lsa_OpenPolicy2 (
338                 [in]      unistr *system_name,
339                 [in,ref]  lsa_ObjectAttribute *attr,
340                 [in]      uint32 desired_access,
341                 [out,ref] policy_handle *handle
342                 );
343
344
345         /* Function:    0x2d */
346         NTSTATUS UNK_GET_CONNUSER ();
347         /* Function:          0x2e */
348         NTSTATUS QUERYINFO2 ();
349
350
351
352 }