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