r4157: QueryMultipleValues IDL and torture test
[samba.git] / source4 / librpc / idl / winreg.idl
1 #include "idl_types.h"
2
3 /*
4   winreg interface definition
5 */
6
7 [ uuid("338cd001-2244-31f1-aaaa-900038001003"),
8   version(1.0),
9   endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"),
10   pointer_default(unique),
11   helpstring("Remote Registry Service"),
12   depends(lsa)
13 ] interface winreg
14 {
15         typedef struct {
16                 [value(strlen_m_term(r->name)*2)] uint16 name_len;
17                 [value(r->name_len)]              uint16 name_size;
18                 unistr *name;
19         } winreg_String;
20
21         typedef struct {
22                 uint16 unknown0;
23                 uint16 unknown1;
24         } winreg_OpenUnknown;
25
26         /******************/
27         /* Function: 0x00 */
28         WERROR winreg_OpenHKCR(
29                 [in]      winreg_OpenUnknown *unknown,
30                 [in]      uint32 access_required,
31                 [out,ref] policy_handle *handle
32         );
33
34         /******************/
35         /* Function: 0x01 */
36         WERROR winreg_OpenHKCU(
37                 [in]      winreg_OpenUnknown *unknown,
38                 [in]      uint32 access_required,
39                 [out,ref] policy_handle *handle
40         );
41
42         /******************/
43         /* Function: 0x02 */
44         WERROR winreg_OpenHKLM(
45                 [in]      winreg_OpenUnknown *unknown,
46                 [in]      uint32 access_required,
47                 [out,ref] policy_handle *handle
48         );
49
50         /******************/
51         /* Function: 0x03 */
52         WERROR winreg_OpenHKPD(
53                 [in]      winreg_OpenUnknown *unknown,
54                 [in]      uint32 access_required,
55                 [out,ref] policy_handle *handle
56         );
57
58         /******************/
59         /* Function: 0x04 */
60         WERROR winreg_OpenHKU(
61                 [in]      winreg_OpenUnknown *unknown,
62                 [in]      uint32 access_required,
63                 [out,ref] policy_handle *handle
64         );
65
66         /******************/
67         /* Function: 0x05 */
68         WERROR winreg_CloseKey(
69                 [in,out,ref] policy_handle *handle
70         );
71
72         /******************/
73         /* Function: 0x06 */
74         WERROR winreg_CreateKey(
75                 [in,out,ref] policy_handle *handle,
76                 [in] winreg_String key,
77                 [in] winreg_String class,
78                 [in] uint32 reserved,
79                 [out] uint32 *unknown,
80                 [in] uint32 access_mask,
81                 [in,ref] uint32 *sec_info,
82                 [in] sec_desc_buf *sec_desc
83         );
84
85         /******************/
86         /* Function: 0x07 */
87         WERROR winreg_DeleteKey(
88                 [in,ref] policy_handle *handle,
89                 [in]     winreg_String key
90         );
91
92         /******************/
93         /* Function: 0x08 */
94         WERROR winreg_DeleteValue(
95                 [in,ref] policy_handle *handle,
96                 [in]     winreg_String value
97         );
98
99         typedef struct {
100                 uint32 low;
101                 uint32 high;
102         } winreg_Time;
103
104         typedef struct {
105                 uint32 unknown;
106                 winreg_String key_name;
107         } winreg_EnumKeyNameRequest;
108
109         typedef struct {
110                 uint32 unknown1;
111                 uint32 unknown2;
112                 lstring name;
113         } winreg_EnumKeyNameResponse;
114
115         /******************/
116         /* Function: 0x09 */
117         WERROR winreg_EnumKey(
118                 [in,ref]    policy_handle *handle,
119                 [in] uint32 enum_index,
120                 [in,out]    uint16 key_name_len,
121                 [in,out]    uint16 unknown,
122                 [in]        winreg_EnumKeyNameRequest *in_name,
123                 [out]       winreg_EnumKeyNameResponse *out_name,
124                 [in,out]    winreg_String *class,
125                 [in,out]    winreg_Time *last_changed_time
126         );
127
128         /******************/
129         /* Function: 0x0a */
130
131         /* 
132            this is equivalent IDL to a winreg_String, but we need to
133            have absolute control over the length/size fields as the
134            server looks at those to see what size buffer we have, so
135            we can't use the automatic unistr handing in pidl.
136         */
137         typedef struct {
138                 uint16 length;
139                 uint16 size;
140                 [size_is(size/2),length_is(length/2)] uint16 *name;
141         } winreg_EnumValueString;
142
143         WERROR winreg_EnumValue(
144                 [in,ref] policy_handle *handle,
145                 [in]     uint32 enum_index,
146                 [in]     winreg_EnumValueString name_in,
147                 [out]    winreg_String name_out,
148                 [in,out] uint32 *type,
149                 [in,out,size_is(*size),length_is(*length)] uint8 *value,
150                 [in,out] uint32 *size,
151                 [in,out] uint32 *length
152         );
153
154         /******************/
155         /* Function: 0x0b */
156         WERROR winreg_FlushKey(
157                 [in,ref] policy_handle *handle
158         );
159
160         typedef struct {
161                 [size_is(size),length_is(len)] uint8 *data;
162                 uint32 size;
163                 uint32 len;
164         } KeySecurityData;
165
166         /******************/
167         /* Function: 0x0c */
168         WERROR winreg_GetKeySecurity(
169                 [in,ref] policy_handle *handle,
170                 [in] uint32 access_mask,
171                 [in,out,ref] KeySecurityData *data
172         );
173
174         /******************/
175         /* Function: 0x0d */
176         WERROR winreg_LoadKey(
177                 [in,ref] policy_handle *handle,
178                 [in] winreg_String *keyname,
179                 [in] winreg_String *filename
180         );
181
182         /******************/
183         /* Function: 0x0e */
184         WERROR winreg_NotifyChangeKeyValue(
185         );
186
187         /******************/
188         /* Function: 0x0f */
189         WERROR winreg_OpenKey(
190                 [in,ref] policy_handle *handle,
191                 [in] winreg_String keyname,
192                 [in] uint32 unknown,
193                 [in] uint32 access_mask,
194                 [out,ref] policy_handle *handle
195         );
196
197         /******************/
198         /* Function: 0x10 */
199         WERROR winreg_QueryInfoKey(
200                 [in,ref] policy_handle *handle,
201                 [in] winreg_String class,
202                 [out] winreg_String class,
203                 [out] uint32 num_subkeys,
204                 [out] uint32 max_subkeylen,
205                 [out] uint32 max_subkeysize,
206                 [out] uint32 num_values,
207                 [out] uint32 max_valnamelen,
208                 [out] uint32 max_valbufsize,
209                 [out] uint32 secdescsize,
210                 [out] winreg_Time last_changed_time
211         );
212
213         /******************/
214         /* Function: 0x11 */
215         WERROR winreg_QueryValue(
216                 [in,ref] policy_handle *handle,
217                 [in] winreg_String value_name,
218                 [in,out] uint32 *type,
219                 [in,out,size_is(*size),length_is(*length)] uint8 *data,
220                 [in,out] uint32 *size,
221                 [in,out] uint32 *length
222         );
223
224         /******************/
225         /* Function: 0x12 */
226         WERROR winreg_ReplaceKey(
227         );
228
229         /******************/
230         /* Function: 0x13 */
231         WERROR winreg_RestoreKey(
232         );
233
234         /******************/
235         /* Function: 0x14 */
236         WERROR winreg_SaveKey(
237         );
238
239         /******************/
240         /* Function: 0x15 */
241         WERROR winreg_SetKeySecurity(
242                 [in,ref] policy_handle *handle,
243                 [in] uint32 access_mask,
244                 [in,out,ref] KeySecurityData *data
245         );
246
247         /******************/
248         /* Function: 0x16 */
249         WERROR winreg_SetValue(
250                 [in,ref]           policy_handle *handle,
251                 [in]               winreg_String name,
252                 [in]               uint32 type,
253                 [in,size_is(size)] uint8  *data,
254                 [in]               uint32 size
255         );
256
257         /******************/
258         /* Function: 0x17 */
259         WERROR winreg_UnLoadKey(
260         );
261
262         /******************/
263         /* Function: 0x18 */
264         WERROR winreg_InitiateSystemShutdown(
265                 [in]    winreg_String hostname,
266                 [in]    winreg_String message,
267                 [in]    uint32 timeout,
268                 [in]    uint16 flags,
269                 [out]   uint16 status
270         );
271
272         /******************/
273         /* Function: 0x19 */
274         WERROR winreg_AbortSystemShutdown(
275                 [in,ref]        uint16 *server
276         );
277
278         /******************/
279         /* Function: 0x1a */
280         WERROR winreg_GetVersion(
281                 [in,ref] policy_handle *handle,
282                 [out]    uint32 version
283         );
284
285         /******************/
286         /* Function: 0x1b */
287         WERROR winreg_OpenHKCC(
288                 [in]      winreg_OpenUnknown *unknown,
289                 [in]      uint32 access_required,
290                 [out,ref] policy_handle *handle
291         );
292
293         /******************/
294         /* Function: 0x1c */
295         WERROR winreg_OpenHKDD(
296                 [in]      winreg_OpenUnknown *unknown,
297                 [in]      uint32 access_required,
298                 [out,ref] policy_handle *handle
299         );
300
301         typedef struct {
302                 winreg_String *name;
303                 uint32 type;
304                 uint32 offset;
305                 uint32 length;
306         } QueryMultipleValue;
307         
308         /******************/
309         /* Function: 0x1d */
310         WERROR winreg_QueryMultipleValues(
311                 [in,ref] policy_handle *key_handle, 
312                 [in,out,size_is(num_values),length_is(num_values),ref] QueryMultipleValue *values,
313         [in] uint32 num_values,
314         [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer,
315         [in,out,ref] uint32 *buffer_size
316         );
317
318         /******************/
319         /* Function: 0x1e */
320         WERROR winreg_InitiateSystemShutdownEx(
321                 );
322
323         /******************/
324         /* Function: 0x1f */
325         WERROR winreg_SaveKeyEx(
326         );
327
328         /******************/
329         /* Function: 0x20 */
330         WERROR winreg_OpenHKPT(
331                 [in]      winreg_OpenUnknown *unknown,
332                 [in]      uint32 access_required,
333                 [out,ref] policy_handle *handle
334         );
335
336         /******************/
337         /* Function: 0x21 */
338         WERROR winreg_OpenHKPN(
339                 [in]      winreg_OpenUnknown *unknown,
340                 [in]      uint32 access_required,
341                 [out,ref] policy_handle *handle
342         );
343
344         /******************/
345         /* Function: 0x22 */
346         WERROR winreg_QueryMultipleValues2(
347         );
348 }