370ca828b13b654403d756b56381b767c7a46136
[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         );
178
179         /******************/
180         /* Function: 0x0e */
181         WERROR winreg_NotifyChangeKeyValue(
182         );
183
184         /******************/
185         /* Function: 0x0f */
186         WERROR winreg_OpenKey(
187                 [in,ref] policy_handle *handle,
188                 [in] winreg_String keyname,
189                 [in] uint32 unknown,
190                 [in] uint32 access_mask,
191                 [out,ref] policy_handle *handle
192         );
193
194         /******************/
195         /* Function: 0x10 */
196         WERROR winreg_QueryInfoKey(
197                 [in,ref] policy_handle *handle,
198                 [in] winreg_String class,
199                 [out] winreg_String class,
200                 [out] uint32 num_subkeys,
201                 [out] uint32 max_subkeylen,
202                 [out] uint32 max_subkeysize,
203                 [out] uint32 num_values,
204                 [out] uint32 max_valnamelen,
205                 [out] uint32 max_valbufsize,
206                 [out] uint32 secdescsize,
207                 [out] winreg_Time last_changed_time
208         );
209
210         /******************/
211         /* Function: 0x11 */
212         WERROR winreg_QueryValue(
213                 [in,ref] policy_handle *handle,
214                 [in] winreg_String value_name,
215                 [in,out] uint32 *type,
216                 [in,out,size_is(*size),length_is(*length)] uint8 *data,
217                 [in,out] uint32 *size,
218                 [in,out] uint32 *length
219         );
220
221         /******************/
222         /* Function: 0x12 */
223         WERROR winreg_ReplaceKey(
224         );
225
226         /******************/
227         /* Function: 0x13 */
228         WERROR winreg_RestoreKey(
229         );
230
231         /******************/
232         /* Function: 0x14 */
233         WERROR winreg_SaveKey(
234         );
235
236         /******************/
237         /* Function: 0x15 */
238         WERROR winreg_SetKeySecurity(
239                 [in,ref] policy_handle *handle,
240                 [in] uint32 sec_info,
241                 [in] sec_desc_buf *sec_desc
242         );
243
244         /******************/
245         /* Function: 0x16 */
246         WERROR winreg_SetValue(
247                 [in,ref]           policy_handle *handle,
248                 [in]               winreg_String name,
249                 [in]               uint32 type,
250                 [in,size_is(size)] uint8  *data,
251                 [in]               uint32 size
252         );
253
254         /******************/
255         /* Function: 0x17 */
256         WERROR winreg_UnLoadKey(
257         );
258
259         /******************/
260         /* Function: 0x18 */
261         WERROR winreg_InitiateSystemShutdown(
262                 [in]    winreg_String hostname,
263                 [in]    winreg_String message,
264                 [in]    uint32 timeout,
265                 [in]    uint16 flags,
266                 [out]   uint16 status
267         );
268
269         /******************/
270         /* Function: 0x19 */
271         WERROR winreg_AbortSystemShutdown(
272                 [in,ref]        uint16 *server
273         );
274
275         /******************/
276         /* Function: 0x1a */
277         WERROR winreg_GetVersion(
278                 [in,ref] policy_handle *handle,
279                 [out]    uint32 version
280         );
281
282         /******************/
283         /* Function: 0x1b */
284         WERROR winreg_OpenHKCC(
285                 [in]      winreg_OpenUnknown *unknown,
286                 [in]      uint32 access_required,
287                 [out,ref] policy_handle *handle
288         );
289
290         /******************/
291         /* Function: 0x1c */
292         WERROR winreg_OpenHKDD(
293                 [in]      winreg_OpenUnknown *unknown,
294                 [in]      uint32 access_required,
295                 [out,ref] policy_handle *handle
296         );
297
298         /******************/
299         /* Function: 0x1d */
300         WERROR winreg_QueryMultipleValues(
301         );
302
303         /******************/
304         /* Function: 0x1e */
305         WERROR winreg_InitiateSystemShutdownEx(
306                 );
307
308         /******************/
309         /* Function: 0x1f */
310         WERROR winreg_SaveKeyEx(
311         );
312
313         /******************/
314         /* Function: 0x20 */
315         WERROR winreg_OpenHKPT(
316                 [in]      winreg_OpenUnknown *unknown,
317                 [in]      uint32 access_required,
318                 [out,ref] policy_handle *handle
319         );
320
321         /******************/
322         /* Function: 0x21 */
323         WERROR winreg_OpenHKPN(
324                 [in]      winreg_OpenUnknown *unknown,
325                 [in]      uint32 access_required,
326                 [out,ref] policy_handle *handle
327         );
328
329         /******************/
330         /* Function: 0x22 */
331         WERROR winreg_QueryMultipleValues2(
332         );
333 }