Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
[ira/wip.git] / source3 / librpc / idl / winreg.idl
1 /*
2   winreg interface definition
3 */
4
5 import "lsa.idl", "initshutdown.idl", "security.idl";
6
7
8   uuid("338cd001-2244-31f1-aaaa-900038001003"),
9   version(1.0),
10   endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"),
11   pointer_default(unique),
12   pointer_default_top(unique),
13   helpstring("Remote Registry Service")
14 ] interface winreg
15 {
16         typedef bitmap security_secinfo security_secinfo;
17
18         typedef [bitmap32bit] bitmap {
19                 KEY_QUERY_VALUE                 = 0x00001,
20                 KEY_SET_VALUE                   = 0x00002,
21                 KEY_CREATE_SUB_KEY              = 0x00004,
22                 KEY_ENUMERATE_SUB_KEYS  = 0x00008,
23                 KEY_NOTIFY                              = 0x00010,
24                 KEY_CREATE_LINK                 = 0x00020,
25                 KEY_WOW64_64KEY                 = 0x00100,
26                 KEY_WOW64_32KEY                 = 0x00200
27         } winreg_AccessMask;
28
29         typedef [v1_enum] enum {
30                 REG_NONE                       = 0,
31                 REG_SZ                         = 1,
32                 REG_EXPAND_SZ                  = 2,
33                 REG_BINARY                     = 3,
34                 REG_DWORD                      = 4,
35                 REG_DWORD_BIG_ENDIAN           = 5,
36                 REG_LINK                       = 6,
37                 REG_MULTI_SZ                   = 7,
38                 REG_RESOURCE_LIST              = 8,
39                 REG_FULL_RESOURCE_DESCRIPTOR   = 9,
40                 REG_RESOURCE_REQUIREMENTS_LIST = 10,
41                 REG_QWORD                      = 11
42         } winreg_Type;
43
44         typedef [public,noejs] struct {
45                 [value(strlen_m_term(name)*2)] uint16 name_len;
46                 [value(strlen_m_term(name)*2)] uint16 name_size;
47                 [string,charset(UTF16)] uint16 *name;
48         } winreg_String;
49
50         /******************/
51         /* Function: 0x00 */
52         WERROR winreg_OpenHKCR(
53                 [in]      uint16 *system_name,
54                 [in]      winreg_AccessMask access_mask,
55                 [out,ref] policy_handle *handle
56         );
57
58         /******************/
59         /* Function: 0x01 */
60         WERROR winreg_OpenHKCU(
61                 [in]      uint16 *system_name,
62                 [in]      winreg_AccessMask access_mask,
63                 [out,ref] policy_handle *handle
64         );
65
66         /******************/
67         /* Function: 0x02 */
68         WERROR winreg_OpenHKLM(
69                 [in]      uint16 *system_name,
70                 [in]      winreg_AccessMask access_mask,
71                 [out,ref] policy_handle *handle
72         );
73
74         /******************/
75         /* Function: 0x03 */
76         WERROR winreg_OpenHKPD(
77                 [in]      uint16 *system_name,
78                 [in]      winreg_AccessMask access_mask,
79                 [out,ref] policy_handle *handle
80         );
81
82         /******************/
83         /* Function: 0x04 */
84         WERROR winreg_OpenHKU(
85                 [in]      uint16 *system_name,
86                 [in]      winreg_AccessMask access_mask,
87                 [out,ref] policy_handle *handle
88         );
89
90         /******************/
91         /* Function: 0x05 */
92         WERROR winreg_CloseKey(
93                 [in,out,ref] policy_handle *handle
94         );
95
96         /******************/
97         /* Function: 0x06 */
98
99         typedef struct {
100                 [size_is(size),length_is(len)] uint8 *data;
101                 uint32 size;
102                 uint32 len;
103         } KeySecurityData;
104
105         typedef struct {
106                 uint32 length;
107                 KeySecurityData sd;
108                 boolean8  inherit;
109         } winreg_SecBuf;
110
111         typedef [v1_enum] enum {
112                 REG_ACTION_NONE         = 0, /* used by caller */
113                 REG_CREATED_NEW_KEY     = 1,
114                 REG_OPENED_EXISTING_KEY = 2
115         } winreg_CreateAction;
116
117         WERROR winreg_CreateKey(
118                 [in,ref] policy_handle *handle,
119                 [in] winreg_String name,
120                 [in] winreg_String keyclass,
121                 [in] uint32 options,
122                 [in] winreg_AccessMask access_mask,
123                 [in,unique] winreg_SecBuf *secdesc,
124                 [out,ref] policy_handle *new_handle,
125                 [in,out,unique] winreg_CreateAction *action_taken
126         );
127
128         /******************/
129         /* Function: 0x07 */
130         WERROR winreg_DeleteKey(
131                 [in,ref] policy_handle *handle,
132                 [in]     winreg_String key
133         );
134
135         /******************/
136         /* Function: 0x08 */
137         WERROR winreg_DeleteValue(
138                 [in,ref] policy_handle *handle,
139                 [in]     winreg_String value
140         );
141
142         typedef struct {
143                 [value(strlen_m_term_null(name)*2)] uint16 length; 
144                 /* size cannot be auto-set by value() as it is the
145                    amount of space the server is allowed to use for this
146                    string in the reply, not its current size */
147                 uint16 size;
148                 [size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
149         } winreg_StringBuf;
150
151         /******************/
152         /* Function: 0x09 */
153         WERROR winreg_EnumKey(
154                 [in,ref]        policy_handle    *handle,
155                 [in]            uint32           enum_index,
156                 [in,out,ref]    winreg_StringBuf *name,
157                 [in,out,unique] winreg_StringBuf *keyclass,
158                 [in,out,unique] NTTIME           *last_changed_time
159         );
160
161         typedef struct {
162                 [value(strlen_m_term(name)*2)] uint16 length; 
163                 /* size cannot be auto-set by value() as it is the
164                    amount of space the server is allowed to use for this
165                    string in the reply, not its current size */
166                 uint16 size;
167                 [size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
168         } winreg_ValNameBuf;
169
170         /******************/
171         /* Function: 0x0a */
172
173         WERROR winreg_EnumValue(
174                 [in,ref]        policy_handle *handle,
175                 [in]            uint32 enum_index,
176                 [in,out,ref]    winreg_ValNameBuf *name,
177                 [in,out,unique] winreg_Type *type,
178                 [in,out,unique,size_is(*size),length_is(*length)] uint8 *value,
179                 [in,out,unique] uint32 *size,
180                 [in,out,unique] uint32 *length
181         );
182
183         /******************/
184         /* Function: 0x0b */
185         WERROR winreg_FlushKey(
186                 [in,ref] policy_handle *handle
187         );
188
189         /******************/
190         /* Function: 0x0c */
191         WERROR winreg_GetKeySecurity(
192                 [in,ref] policy_handle *handle,
193                 [in] security_secinfo sec_info,
194                 [in,out,ref] KeySecurityData *sd
195         );
196
197         /******************/
198         /* Function: 0x0d */
199         WERROR winreg_LoadKey(
200                 [in,ref] policy_handle *handle,
201                 [in] winreg_String *keyname,
202                 [in] winreg_String *filename
203         );
204
205         /******************/
206         /* Function: 0x0e */
207         WERROR winreg_NotifyChangeKeyValue(
208                 [in,ref] policy_handle *handle,
209                 [in] uint8 watch_subtree,
210                 [in] uint32 notify_filter,
211                 [in] uint32 unknown,
212                 [in] winreg_String string1,
213                 [in] winreg_String string2, 
214                 [in] uint32 unknown2
215         );
216
217         /******************/
218         /* Function: 0x0f */
219         WERROR winreg_OpenKey(
220                 [in,ref] policy_handle *parent_handle,
221                 [in] winreg_String keyname,
222                 [in] uint32 unknown,
223                 [in] winreg_AccessMask access_mask,
224                 [out,ref] policy_handle *handle
225         );
226
227         /******************/
228         /* Function: 0x10 */
229         WERROR winreg_QueryInfoKey(
230                 [in,ref] policy_handle *handle,
231                 [in,out,ref] winreg_String *classname,
232                 [out,ref] uint32 *num_subkeys,
233                 [out,ref] uint32 *max_subkeylen,
234                 [out,ref] uint32 *max_classlen,
235                 [out,ref] uint32 *num_values,
236                 [out,ref] uint32 *max_valnamelen,
237                 [out,ref] uint32 *max_valbufsize,
238                 [out,ref] uint32 *secdescsize,
239                 [out,ref] NTTIME *last_changed_time
240         );
241
242         /******************/
243         /* Function: 0x11 */
244         WERROR winreg_QueryValue(
245                 [in,ref] policy_handle *handle,
246                 [in] winreg_String value_name,
247                 [in,out] winreg_Type *type,
248                 [in,out,size_is(*data_size),length_is(*value_length)] uint8 *data,
249                 [in,out] uint32 *data_size,
250                 [in,out] uint32 *value_length
251         );
252
253         /******************/
254         /* Function: 0x12 */
255         WERROR winreg_ReplaceKey(
256         );
257
258         /******************/
259         /* Function: 0x13 */
260         WERROR winreg_RestoreKey(
261                 [in,ref] policy_handle *handle,
262                 [in,ref] winreg_String *filename,
263                 [in]     uint32 flags 
264         );
265
266         /******************/
267         /* Function: 0x14 */
268
269         typedef struct {
270                 uint32 data_size;
271                 KeySecurityData sec_data;
272                 uint8 inherit;
273         } KeySecurityAttribute;
274
275         WERROR winreg_SaveKey(
276                 [in,ref] policy_handle *handle,
277                 [in,ref] winreg_String *filename,
278                 [in,unique] KeySecurityAttribute *sec_attrib
279         );
280
281         /******************/
282         /* Function: 0x15 */
283         WERROR winreg_SetKeySecurity(
284                 [in,ref] policy_handle *handle,
285                 [in] winreg_AccessMask access_mask,
286                 [in,ref] KeySecurityData *sd
287         );
288
289         /******************/
290         /* Function: 0x16 */
291         WERROR winreg_SetValue(
292                 [in,ref]           policy_handle *handle,
293                 [in]               winreg_String name,
294                 [in]               winreg_Type type,
295                 [in,size_is(size),ref] uint8  *data,
296                 [in]               uint32 size
297         );
298
299         /******************/
300         /* Function: 0x17 */
301         WERROR winreg_UnLoadKey(
302         );
303
304         /******************/
305         /* Function: 0x18 */
306         WERROR winreg_InitiateSystemShutdown(
307                 [in]    uint16 *hostname,
308                 [in]    initshutdown_String *message,
309                 [in]    uint32 timeout,
310                 [in]    uint8 force_apps,
311                 [in]    uint8 reboot
312         );
313
314         /******************/
315         /* Function: 0x19 */
316         WERROR winreg_AbortSystemShutdown(
317                 [in]    uint16 *server
318         );
319
320         /******************/
321         /* Function: 0x1a */
322         WERROR winreg_GetVersion(
323                 [in,ref]     policy_handle *handle,
324                 [out,ref]    uint32 *version
325         );
326
327         /******************/
328         /* Function: 0x1b */
329         WERROR winreg_OpenHKCC(
330                 [in]      uint16 *system_name,
331                 [in]      winreg_AccessMask access_mask,
332                 [out,ref] policy_handle *handle
333         );
334
335         /******************/
336         /* Function: 0x1c */
337         WERROR winreg_OpenHKDD(
338                 [in]      uint16 *system_name,
339                 [in]      winreg_AccessMask access_mask,
340                 [out,ref] policy_handle *handle
341         );
342
343         typedef struct {
344                 winreg_String *name;
345                 winreg_Type type;
346                 uint32 offset;
347                 uint32 length;
348         } QueryMultipleValue;
349         
350         /******************/
351         /* Function: 0x1d */
352         WERROR winreg_QueryMultipleValues(
353                 [in,ref] policy_handle *key_handle, 
354                 [in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values,
355                 [in] uint32 num_values,
356                 [in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer,
357                 [in,out,ref] uint32 *buffer_size
358         );
359
360         /******************/
361         /* Function: 0x1e */
362         WERROR winreg_InitiateSystemShutdownEx(
363                 [in] uint16 *hostname,
364                 [in] initshutdown_String *message,
365                 [in] uint32 timeout,
366                 [in] uint8 force_apps,
367                 [in] uint8 reboot,
368                 [in] uint32 reason
369         );
370
371         /******************/
372         /* Function: 0x1f */
373         WERROR winreg_SaveKeyEx(
374         );
375
376         /******************/
377         /* Function: 0x20 */
378         WERROR winreg_OpenHKPT(
379                 [in]      uint16 *system_name,
380                 [in]      winreg_AccessMask access_mask,
381                 [out,ref] policy_handle *handle
382         );
383
384         /******************/
385         /* Function: 0x21 */
386         WERROR winreg_OpenHKPN(
387                 [in]      uint16 *system_name,
388                 [in]      winreg_AccessMask access_mask,
389                 [out,ref] policy_handle *handle
390         );
391
392         /******************/
393         /* Function: 0x22 */
394         WERROR winreg_QueryMultipleValues2(
395         );
396 }