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