Removed version number from file header.
[kai/samba.git] / source3 / include / rpc_reg.h
1 /* 
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell 1992-1997
5    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6    Copyright (C) Paul Ashton 1997
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #ifndef _RPC_REG_H /* _RPC_REG_H */
24 #define _RPC_REG_H 
25
26
27 /* winreg pipe defines */
28 #define REG_OPEN_HKCR           0x00
29 #define _REG_UNK_01             0x01
30 #define REG_OPEN_HKLM           0x02
31 #define _REG_UNK_03             0x03
32 #define REG_OPEN_HKU            0x04
33 #define REG_CLOSE               0x05
34 #define REG_CREATE_KEY          0x06
35 #define REG_DELETE_KEY          0x07
36 #define REG_DELETE_VALUE        0x08
37 #define REG_ENUM_KEY            0x09
38 #define REG_ENUM_VALUE          0x0a
39 #define REG_FLUSH_KEY           0x0b
40 #define REG_GET_KEY_SEC         0x0c
41 #define _REG_UNK_0D             0x0d
42 #define _REG_UNK_0E             0x0e
43 #define REG_OPEN_ENTRY          0x0f
44 #define REG_QUERY_KEY           0x10
45 #define REG_INFO                0x11
46 #define _REG_UNK_12             0x12
47 #define _REG_UNK_13             0x13
48 #define _REG_UNK_14             0x14
49 #define REG_SET_KEY_SEC         0x15
50 #define REG_CREATE_VALUE        0x16
51 #define _REG_UNK_17             0x17
52 #define REG_SHUTDOWN            0x18
53 #define REG_ABORT_SHUTDOWN      0x19
54 #define REG_UNK_1A              0x1a
55
56 #define HKEY_CLASSES_ROOT       0x80000000
57 #define HKEY_CURRENT_USER       0x80000001
58 #define HKEY_LOCAL_MACHINE      0x80000002
59 #define HKEY_USERS              0x80000003
60
61 /* Registry data types */
62
63 #define REG_NONE                       0
64 #define REG_SZ                         1
65 #define REG_EXPAND_SZ                  2
66 #define REG_BINARY                     3
67 #define REG_DWORD                      4
68 #define REG_DWORD_LE                   4        /* DWORD, little endian */
69 #define REG_DWORD_BE                   5        /* DWORD, big endian */
70 #define REG_LINK                       6
71 #define REG_MULTI_SZ                   7
72 #define REG_RESOURCE_LIST              8
73 #define REG_FULL_RESOURCE_DESCRIPTOR   9
74 #define REG_RESOURCE_REQUIREMENTS_LIST 10
75
76 /* Shutdown options */
77 #define REG_FORCE_SHUTDOWN 0x001
78 #define REG_REBOOT_ON_SHUTDOWN 0x100
79
80 /* REG_Q_OPEN_HKCR   */
81 typedef struct q_reg_open_hkcr_info
82 {
83         uint32 ptr;
84         uint16 unknown_0; /* 0x5428      - 16 bit unknown */
85         uint16 unknown_1; /* random.  changes */
86         uint32 level;     /* 0x0000 0002 - 32 bit unknown */
87
88 } REG_Q_OPEN_HKCR  ;
89
90 /* REG_R_OPEN_HKCR   */
91 typedef struct r_reg_open_hkcr_info
92 {
93         POLICY_HND pol;       /* policy handle */
94         NTSTATUS status;         /* return status */
95
96 } REG_R_OPEN_HKCR;
97
98
99 /* REG_Q_OPEN_HKLM   */
100 typedef struct q_reg_open_hklm_info
101 {
102         uint32 ptr;
103         uint16 unknown_0;       /* 0xE084      - 16 bit unknown */
104         uint16 unknown_1;       /* random.  changes */
105         uint32 access_mask;     /* 0x0000 0002 - 32 bit unknown */
106
107 }
108 REG_Q_OPEN_HKLM;
109
110 /* REG_R_OPEN_HKLM   */
111 typedef struct r_reg_open_hklm_info
112 {
113         POLICY_HND pol;         /* policy handle */
114         NTSTATUS status;                /* return status */
115
116 }
117 REG_R_OPEN_HKLM;
118
119
120 /* REG_Q_OPEN_HKU */
121 typedef struct q_reg_open_hku_info
122 {
123         uint32 ptr;
124         uint16 unknown_0; /* 0xE084      - 16 bit unknown */
125         uint16 unknown_1; /* random.  changes */
126         uint32 level;     /* 0x0000 0002 - 32 bit unknown */
127
128 } REG_Q_OPEN_HKU;
129
130 /* REG_R_OPEN_HKU */
131 typedef struct r_reg_open_hku_info
132 {
133         POLICY_HND pol;       /* policy handle */
134         NTSTATUS status;         /* return status */
135
136 } REG_R_OPEN_HKU;
137
138
139 /* REG_Q_FLUSH_KEY */
140 typedef struct q_reg_open_flush_key_info
141 {
142         POLICY_HND pol;       /* policy handle */
143
144 } REG_Q_FLUSH_KEY;
145
146 /* REG_R_FLUSH_KEY */
147 typedef struct r_reg_open_flush_key_info
148 {
149         NTSTATUS status;         /* return status */
150
151 } REG_R_FLUSH_KEY;
152
153
154 /* REG_Q_SET_KEY_SEC */
155 typedef struct q_reg_set_key_sec_info
156 {
157         POLICY_HND pol;         /* policy handle */
158
159         uint32 sec_info;       /* xxxx_SECURITY_INFORMATION */
160
161         uint32 ptr;       /* pointer */
162         BUFHDR hdr_sec;    /* header for security data */
163         SEC_DESC_BUF *data;    /* security data */
164         
165 } REG_Q_SET_KEY_SEC;
166
167 /* REG_R_SET_KEY_SEC */
168 typedef struct r_reg_set_key_sec_info
169 {
170         NTSTATUS status;
171         
172 } REG_R_SET_KEY_SEC;
173
174
175 /* REG_Q_GET_KEY_SEC */
176 typedef struct q_reg_get_key_sec_info
177 {
178         POLICY_HND pol;         /* policy handle */
179
180         uint32 sec_info;       /* xxxx_SECURITY_INFORMATION */
181
182         uint32 ptr;       /* pointer */
183         BUFHDR hdr_sec;    /* header for security data */
184         SEC_DESC_BUF *data;    /* security data */
185         
186 } REG_Q_GET_KEY_SEC;
187
188 /* REG_R_GET_KEY_SEC */
189 typedef struct r_reg_get_key_sec_info
190 {
191         uint32 sec_info;       /* xxxx_SECURITY_INFORMATION */
192
193         uint32 ptr;       /* pointer */
194         BUFHDR hdr_sec;    /* header for security data */
195         SEC_DESC_BUF *data;    /* security data */
196
197         NTSTATUS status;
198         
199 } REG_R_GET_KEY_SEC;
200
201 /* REG_Q_CREATE_VALUE */
202 typedef struct q_reg_create_value_info
203 {
204         POLICY_HND pol;    /* policy handle */
205
206         UNIHDR hdr_name;   /* name of value */
207         UNISTR2 uni_name;
208
209         uint32 type;       /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
210
211         BUFFER3 *buf_value; /* value, in byte buffer */
212
213 } REG_Q_CREATE_VALUE;
214
215 /* REG_R_CREATE_VALUE */
216 typedef struct r_reg_create_value_info
217
218         NTSTATUS status;         /* return status */
219
220 } REG_R_CREATE_VALUE;
221
222 /* REG_Q_ENUM_VALUE */
223 typedef struct q_reg_query_value_info
224 {
225         POLICY_HND pol;    /* policy handle */
226
227         uint32 val_index;  /* index */
228
229         UNIHDR hdr_name;   /* name of value */
230         UNISTR2 uni_name;
231
232         uint32 ptr_type;   /* pointer */
233         uint32 type;       /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
234
235         uint32 ptr_value;  /* pointer */
236         BUFFER2 buf_value; /* value, in byte buffer */
237
238         uint32 ptr1;       /* pointer */
239         uint32 len_value1; /* */
240
241         uint32 ptr2;       /* pointer */
242         uint32 len_value2; /* */
243
244 } REG_Q_ENUM_VALUE;
245
246 /* REG_R_ENUM_VALUE */
247 typedef struct r_reg_enum_value_info
248
249         UNIHDR hdr_name;        /* name of value */
250         UNISTR2 uni_name;
251
252         uint32 ptr_type;            /* pointer */
253         uint32 type;        /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
254
255         uint32 ptr_value;       /* pointer */
256         BUFFER2 *buf_value;    /* value, in byte buffer */
257
258         uint32 ptr1;            /* pointer */
259         uint32 len_value1;       /* */
260
261         uint32 ptr2;            /* pointer */
262         uint32 len_value2;       /* */
263
264         NTSTATUS status;         /* return status */
265
266 } REG_R_ENUM_VALUE;
267
268 /* REG_Q_CREATE_KEY */
269 typedef struct q_reg_create_key_info
270 {
271         POLICY_HND pnt_pol;       /* parent key policy handle */
272
273         UNIHDR hdr_name;
274         UNISTR2 uni_name;
275
276         UNIHDR hdr_class;
277         UNISTR2 uni_class;
278
279         uint32 reserved; /* 0x0000 0000 */
280         SEC_ACCESS sam_access; /* access rights flags, see rpc_secdes.h */
281
282         uint32 ptr1;
283         uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
284
285         uint32 ptr2;       /* pointer */
286         BUFHDR hdr_sec;    /* header for security data */
287         uint32 ptr3;       /* pointer */
288         SEC_DESC_BUF *data;
289
290         uint32 unknown_2; /* 0x0000 0000 */
291
292 } REG_Q_CREATE_KEY;
293
294 /* REG_R_CREATE_KEY */
295 typedef struct r_reg_create_key_info
296 {
297         POLICY_HND key_pol;       /* policy handle */
298         uint32 unknown; /* 0x0000 0000 */
299
300         NTSTATUS status;         /* return status */
301
302 } REG_R_CREATE_KEY;
303
304 /* REG_Q_DELETE_KEY */
305 typedef struct q_reg_delete_key_info
306 {
307         POLICY_HND pnt_pol;       /* parent key policy handle */
308
309         UNIHDR hdr_name;
310         UNISTR2 uni_name;
311 } REG_Q_DELETE_KEY;
312
313 /* REG_R_DELETE_KEY */
314 typedef struct r_reg_delete_key_info
315 {
316         POLICY_HND key_pol;       /* policy handle */
317
318         NTSTATUS status;         /* return status */
319
320 } REG_R_DELETE_KEY;
321
322 /* REG_Q_DELETE_VALUE */
323 typedef struct q_reg_delete_val_info
324 {
325         POLICY_HND pnt_pol;       /* parent key policy handle */
326
327         UNIHDR hdr_name;
328         UNISTR2 uni_name;
329
330 } REG_Q_DELETE_VALUE;
331
332 /* REG_R_DELETE_VALUE */
333 typedef struct r_reg_delete_val_info
334 {
335         POLICY_HND key_pol;       /* policy handle */
336
337         NTSTATUS status;         /* return status */
338
339 } REG_R_DELETE_VALUE;
340
341 /* REG_Q_QUERY_KEY */
342 typedef struct q_reg_query_info
343 {
344         POLICY_HND pol;       /* policy handle */
345         UNIHDR hdr_class;
346         UNISTR2 uni_class;
347
348 } REG_Q_QUERY_KEY;
349
350 /* REG_R_QUERY_KEY */
351 typedef struct r_reg_query_key_info
352 {
353         UNIHDR hdr_class;
354         UNISTR2 uni_class;
355
356         uint32 num_subkeys;
357         uint32 max_subkeylen;
358         uint32 max_subkeysize; /* 0x0000 0000 */
359         uint32 num_values;
360         uint32 max_valnamelen;
361         uint32 max_valbufsize; 
362         uint32 sec_desc; /* 0x0000 0078 */
363         NTTIME mod_time;  /* modified time */
364
365         NTSTATUS status;         /* return status */
366
367 } REG_R_QUERY_KEY;
368
369
370 /* REG_Q_UNK_1A */
371 typedef struct q_reg_unk_1a_info
372 {
373         POLICY_HND pol;       /* policy handle */
374
375 } REG_Q_UNK_1A;
376
377 /* REG_R_UNK_1A */
378 typedef struct r_reg_unk_1a_info
379 {
380         uint32 unknown;         /* 0x0500 0000 */
381         NTSTATUS status;         /* return status */
382
383 } REG_R_UNK_1A;
384
385
386 /* REG_Q_CLOSE */
387 typedef struct reg_q_close_info
388 {
389         POLICY_HND pol; /* policy handle */
390
391 } REG_Q_CLOSE;
392
393 /* REG_R_CLOSE */
394 typedef struct reg_r_close_info
395 {
396         POLICY_HND pol; /* policy handle.  should be all zeros. */
397
398         NTSTATUS status; /* return code */
399
400 } REG_R_CLOSE;
401
402
403 /* REG_Q_ENUM_KEY */
404 typedef struct q_reg_enum_value_info
405 {
406         POLICY_HND pol;         /* policy handle */
407
408         uint32 key_index;       
409
410         uint16 key_name_len;    /* 0x0000 */
411         uint16 unknown_1;       /* 0x0414 */
412
413         uint32 ptr1;            /* pointer */
414         uint32 unknown_2;       /* 0x0000 020A */
415         uint8  pad1[8];         /* padding - zeros */
416
417         uint32 ptr2;            /* pointer */
418         uint8  pad2[8];         /* padding - zeros */
419
420         uint32 ptr3;            /* pointer */
421         NTTIME time;            /* current time? */
422
423 } REG_Q_ENUM_KEY;
424
425 /* REG_R_ENUM_KEY */
426 typedef struct r_reg_enum_key_info
427
428         uint16 key_name_len;    /* number of bytes in key name */
429         uint16 unknown_1;       /* 0x0414 - matches with query unknown_1 */
430
431         uint32 ptr1;            /* pointer */
432         uint32 unknown_2;       /* 0x0000 020A */
433         uint32 unknown_3;       /* 0x0000 0000 */
434
435         UNISTR3 key_name;
436
437         uint32 ptr2;            /* pointer */
438         uint8  pad2[8];         /* padding - zeros */
439
440         uint32 ptr3;            /* pointer */
441         NTTIME time;            /* current time? */
442
443         NTSTATUS status;         /* return status */
444
445 } REG_R_ENUM_KEY;
446
447
448 /* REG_Q_INFO */
449 typedef struct q_reg_info_info
450 {
451         POLICY_HND pol;         /* policy handle */
452
453         UNIHDR  hdr_type;       /* unicode product type header */
454         UNISTR2 uni_type;       /* unicode product type - "ProductType" */
455
456         uint32 ptr_reserved;    /* pointer */
457   
458         uint32 ptr_buf;         /* the next three fields follow if ptr_buf != 0 */
459         uint32 ptr_bufsize;
460         uint32 bufsize;
461         uint32 buf_unk;
462
463         uint32 unk1;
464         uint32 ptr_buflen;
465         uint32 buflen;
466   
467         uint32 ptr_buflen2;
468         uint32 buflen2;
469
470 } REG_Q_INFO;
471
472 /* REG_R_INFO */
473 typedef struct r_reg_info_info
474
475         uint32 ptr_type;        /* key type pointer */
476         uint32 type;            /* key datatype  */
477
478         uint32 ptr_uni_val;     /* key value pointer */
479         BUFFER2 *uni_val;       /* key value */
480
481         uint32 ptr_max_len;
482         uint32 buf_max_len;
483
484         uint32 ptr_len;
485         uint32 buf_len;
486   
487         NTSTATUS status;        /* return status */
488
489 } REG_R_INFO;
490
491
492 /* REG_Q_OPEN_ENTRY */
493 typedef struct q_reg_open_entry_info
494 {
495         POLICY_HND pol;        /* policy handle */
496
497         UNIHDR  hdr_name;       /* unicode registry string header */
498         UNISTR2 uni_name;       /* unicode registry string name */
499
500         uint32 unknown_0;       /* 32 bit unknown - 0x0000 0000 */
501         uint32 unknown_1;       /* 32 bit unknown - 0x0200 0000 */
502
503 } REG_Q_OPEN_ENTRY;
504
505
506
507 /* REG_R_OPEN_ENTRY */
508 typedef struct r_reg_open_entry_info
509 {
510         POLICY_HND pol;       /* policy handle */
511         NTSTATUS status;         /* return status */
512
513 } REG_R_OPEN_ENTRY;
514
515 /* REG_Q_SHUTDOWN */
516 typedef struct q_reg_shutdown_info
517 {
518         uint32 ptr_0;
519         uint32 ptr_1;
520         uint32 ptr_2;
521         UNIHDR hdr_msg;         /* shutdown message */
522         UNISTR2 uni_msg;        /* seconds */
523         uint32 timeout;         /* seconds */
524         uint16 flags;
525                 
526 } REG_Q_SHUTDOWN;
527
528 /* REG_R_SHUTDOWN */
529 typedef struct r_reg_shutdown_info
530 {
531         NTSTATUS status;                /* return status */
532
533 } REG_R_SHUTDOWN;
534
535 /* REG_Q_ABORT_SHUTDOWN */
536 typedef struct q_reg_abort_shutdown_info
537 {
538         uint32 ptr_server;
539         uint16 server;
540
541 } REG_Q_ABORT_SHUTDOWN;
542
543 /* REG_R_ABORT_SHUTDOWN */
544 typedef struct r_reg_abort_shutdown_info
545
546         NTSTATUS status; /* return status */
547
548 } REG_R_ABORT_SHUTDOWN;
549
550
551 #endif /* _RPC_REG_H */
552