37049142d23652dfb259420198dfc03059bcd47e
[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 options,
79                 [in] uint32 access_mask,
80                 [in,out,ref] uint32 *action_taken,
81                 [in] sec_desc_buf *sec_desc
82         );
83
84         /******************/
85         /* Function: 0x07 */
86         WERROR winreg_DeleteKey(
87                 [in,ref] policy_handle *handle,
88                 [in]     winreg_String key
89         );
90
91         /******************/
92         /* Function: 0x08 */
93         WERROR winreg_DeleteValue(
94                 [in,ref] policy_handle *handle,
95                 [in]     winreg_String value
96         );
97
98         typedef struct {
99                 uint32 low;
100                 uint32 high;
101         } winreg_Time;
102
103         typedef struct {
104                 uint32 unknown;
105                 winreg_String key_name;
106         } winreg_EnumKeyNameRequest;
107
108         typedef struct {
109                 uint32 unknown1;
110                 uint32 unknown2;
111                 lstring name;
112         } winreg_EnumKeyNameResponse;
113
114         /******************/
115         /* Function: 0x09 */
116         WERROR winreg_EnumKey(
117                 [in,ref]    policy_handle *handle,
118                 [in] uint32 enum_index,
119                 [in,out]    uint16 key_name_len,
120                 [in,out]    uint16 unknown,
121                 [in]        winreg_EnumKeyNameRequest *in_name,
122                 [out]       winreg_EnumKeyNameResponse *out_name,
123                 [in,out]    winreg_String *class,
124                 [in,out]    winreg_Time *last_changed_time
125         );
126
127         /******************/
128         /* Function: 0x0a */
129
130         /* 
131            this is equivalent IDL to a winreg_String, but we need to
132            have absolute control over the length/size fields as the
133            server looks at those to see what size buffer we have, so
134            we can't use the automatic unistr handing in pidl.
135         */
136         typedef struct {
137                 uint16 length;
138                 uint16 size;
139                 [size_is(size/2),length_is(length/2)] uint16 *name;
140         } winreg_EnumValueString;
141
142         WERROR winreg_EnumValue(
143                 [in,ref] policy_handle *handle,
144                 [in]     uint32 enum_index,
145                 [in]     winreg_EnumValueString name_in,
146                 [out]    winreg_String name_out,
147                 [in,out] uint32 *type,
148                 [in,out,size_is(*size),length_is(*length)] uint8 *value,
149                 [in,out] uint32 *size,
150                 [in,out] uint32 *length
151         );
152
153         /******************/
154         /* Function: 0x0b */
155         WERROR winreg_FlushKey(
156                 [in,ref] policy_handle *handle
157         );
158
159         typedef struct {
160                 [size_is(size),length_is(len)] uint8 *data;
161                 uint32 size;
162                 uint32 len;
163         } KeySecurityData;
164
165         /******************/
166         /* Function: 0x0c */
167         WERROR winreg_GetKeySecurity(
168                 [in,ref] policy_handle *handle,
169                 [in] uint32 access_mask,
170                 [in,out,ref] KeySecurityData *data
171         );
172
173         /******************/
174         /* Function: 0x0d */
175         WERROR winreg_LoadKey(
176                 [in,ref] policy_handle *handle,
177                 [in] winreg_String *keyname,
178                 [in] winreg_String *filename
179         );
180
181         /******************/
182         /* Function: 0x0e */
183         WERROR winreg_NotifyChangeKeyValue(
184                 [in,ref] policy_handle *handle,
185                 [in] uint8 watch_subtree,
186                 [in] uint32 notify_filter,
187                 [in] uint32 unknown,
188                 [in] winreg_String string1,
189                 [in] winreg_String string2, 
190                 [in] uint32 unknown2
191         );
192
193         /******************/
194         /* Function: 0x0f */
195         WERROR winreg_OpenKey(
196                 [in,ref] policy_handle *handle,
197                 [in] winreg_String keyname,
198                 [in] uint32 unknown,
199                 [in] uint32 access_mask,
200                 [out,ref] policy_handle *handle
201         );
202
203         /******************/
204         /* Function: 0x10 */
205         WERROR winreg_QueryInfoKey(
206                 [in,ref] policy_handle *handle,
207                 [in] winreg_String class,
208                 [out] winreg_String class,
209                 [out] uint32 num_subkeys,
210                 [out] uint32 max_subkeylen,
211                 [out] uint32 max_subkeysize,
212                 [out] uint32 num_values,
213                 [out] uint32 max_valnamelen,
214                 [out] uint32 max_valbufsize,
215                 [out] uint32 secdescsize,
216                 [out] winreg_Time last_changed_time
217         );
218
219         /******************/
220         /* Function: 0x11 */
221         WERROR winreg_QueryValue(
222                 [in,ref] policy_handle *handle,
223                 [in] winreg_String value_name,
224                 [in,out] uint32 *type,
225                 [in,out,size_is(*size),length_is(*length)] uint8 *data,
226                 [in,out] uint32 *size,
227                 [in,out] uint32 *length
228         );
229
230         /******************/
231         /* Function: 0x12 */
232         WERROR winreg_ReplaceKey(
233         );
234
235         /******************/
236         /* Function: 0x13 */
237         WERROR winreg_RestoreKey(
238         );
239
240         /******************/
241         /* Function: 0x14 */
242         WERROR winreg_SaveKey(
243         );
244
245         /******************/
246         /* Function: 0x15 */
247         WERROR winreg_SetKeySecurity(
248                 [in,ref] policy_handle *handle,
249                 [in] uint32 access_mask,
250                 [in,out,ref] KeySecurityData *data
251         );
252
253         /******************/
254         /* Function: 0x16 */
255         WERROR winreg_SetValue(
256                 [in,ref]           policy_handle *handle,
257                 [in]               winreg_String name,
258                 [in]               uint32 type,
259                 [in,size_is(size)] uint8  *data,
260                 [in]               uint32 size
261         );
262
263         /******************/
264         /* Function: 0x17 */
265         WERROR winreg_UnLoadKey(
266         );
267
268         /******************/
269         /* Function: 0x18 */
270         WERROR winreg_InitiateSystemShutdown(
271                 [in]    uint16 *hostname,
272                 [in]    winreg_String *message,
273                 [in]    uint32 timeout,
274                 [in]    uint8 force_apps,
275                 [in]    uint8 reboot
276         );
277
278         /******************/
279         /* Function: 0x19 */
280         WERROR winreg_AbortSystemShutdown(
281                 [in]    uint16 *server
282         );
283
284         /******************/
285         /* Function: 0x1a */
286         WERROR winreg_GetVersion(
287                 [in,ref] policy_handle *handle,
288                 [out]    uint32 version
289         );
290
291         /******************/
292         /* Function: 0x1b */
293         WERROR winreg_OpenHKCC(
294                 [in]      winreg_OpenUnknown *unknown,
295                 [in]      uint32 access_required,
296                 [out,ref] policy_handle *handle
297         );
298
299         /******************/
300         /* Function: 0x1c */
301         WERROR winreg_OpenHKDD(
302                 [in]      winreg_OpenUnknown *unknown,
303                 [in]      uint32 access_required,
304                 [out,ref] policy_handle *handle
305         );
306
307         typedef struct {
308                 winreg_String *name;
309                 uint32 type;
310                 uint32 offset;
311                 uint32 length;
312         } QueryMultipleValue;
313         
314         /******************/
315         /* Function: 0x1d */
316         WERROR winreg_QueryMultipleValues(
317                 [in,ref] policy_handle *key_handle, 
318                 [in,out,size_is(num_values),length_is(num_values),ref] QueryMultipleValue *values,
319         [in] uint32 num_values,
320         [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer,
321         [in,out,ref] uint32 *buffer_size
322         );
323
324         /******************/
325         /* Function: 0x1e */
326         WERROR winreg_InitiateSystemShutdownEx(
327                 );
328
329         /******************/
330         /* Function: 0x1f */
331         WERROR winreg_SaveKeyEx(
332         );
333
334         /******************/
335         /* Function: 0x20 */
336         WERROR winreg_OpenHKPT(
337                 [in]      winreg_OpenUnknown *unknown,
338                 [in]      uint32 access_required,
339                 [out,ref] policy_handle *handle
340         );
341
342         /******************/
343         /* Function: 0x21 */
344         WERROR winreg_OpenHKPN(
345                 [in]      winreg_OpenUnknown *unknown,
346                 [in]      uint32 access_required,
347                 [out,ref] policy_handle *handle
348         );
349
350         /******************/
351         /* Function: 0x22 */
352         WERROR winreg_QueryMultipleValues2(
353         );
354 }