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