776605258884e379efb485ddb0b2e27dfb7e77d5
[samba.git] / source3 / include / rpc_reg.h
1 /* 
2    Unix SMB/Netbios implementation.
3    Version 1.9.
4    SMB parameters and setup
5    Copyright (C) Andrew Tridgell 1992-1997
6    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
7    Copyright (C) Paul Ashton 1997
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _RPC_REG_H /* _RPC_REG_H */
25 #define _RPC_REG_H 
26
27
28 /* winreg pipe defines */
29 #define REG_OPEN_HKLM       0x02
30 #define REG_OPEN_HKU        0x04
31 #define REG_FLUSH_KEY       0x0B
32 #define REG_UNK_1A          0x1a
33 #define REG_QUERY_KEY       0x10
34 #define REG_ENUM_KEY        0x09
35 #define REG_CREATE_KEY      0x06
36 #define REG_DELETE_KEY      0x07
37 #define REG_DELETE_VALUE    0x08
38 #define REG_CREATE_VALUE    0x16
39 #define REG_GET_KEY_SEC     0x0c
40 #define REG_SET_KEY_SEC     0x15
41 #define REG_ENUM_VALUE      0x0a
42 #define REG_OPEN_ENTRY      0x0f
43 #define REG_INFO            0x11
44 #define REG_CLOSE           0x05
45
46 #define HKEY_LOCAL_MACHINE 0x80000000
47 #define HKEY_USERS         0x80000003
48
49 /* REG_Q_OPEN_HKLM   */
50 typedef struct q_reg_open_policy_info
51 {
52         uint32 ptr;
53         uint16 unknown_0; /* 0xE084      - 16 bit unknown */
54         uint16 unknown_1; /* random.  changes */
55         uint32 level;     /* 0x0000 0002 - 32 bit unknown */
56
57 } REG_Q_OPEN_HKLM  ;
58
59 /* REG_R_OPEN_HKLM   */
60 typedef struct r_reg_open_policy_info
61 {
62         POLICY_HND pol;       /* policy handle */
63         uint32 status;         /* return status */
64
65 } REG_R_OPEN_HKLM;
66
67
68 /* REG_Q_OPEN_HKU */
69 typedef struct q_reg_open_unk4_info
70 {
71         uint32 ptr;
72         uint16 unknown_0; /* 0xE084      - 16 bit unknown */
73         uint16 unknown_1; /* random.  changes */
74         uint32 level;     /* 0x0000 0002 - 32 bit unknown */
75
76 } REG_Q_OPEN_HKU;
77
78 /* REG_R_OPEN_HKU */
79 typedef struct r_reg_open_unk4_info
80 {
81         POLICY_HND pol;       /* policy handle */
82         uint32 status;         /* return status */
83
84 } REG_R_OPEN_HKU;
85
86
87 /* REG_Q_FLUSH_KEY */
88 typedef struct q_reg_open_flush_key_info
89 {
90         POLICY_HND pol;       /* policy handle */
91
92 } REG_Q_FLUSH_KEY;
93
94 /* REG_R_FLUSH_KEY */
95 typedef struct r_reg_open_flush_key_info
96 {
97         uint32 status;         /* return status */
98
99 } REG_R_FLUSH_KEY;
100
101
102 /* REG_Q_SET_KEY_SEC */
103 typedef struct q_reg_set_key_sec_info
104 {
105         POLICY_HND pol;         /* policy handle */
106
107         uint32 sec_info;       /* xxxx_SECURITY_INFORMATION */
108
109         uint32 ptr;       /* pointer */
110         BUFHDR hdr_sec;    /* header for security data */
111         SEC_DESC_BUF *data;    /* security data */
112         
113 } REG_Q_SET_KEY_SEC;
114
115 /* REG_R_SET_KEY_SEC */
116 typedef struct r_reg_set_key_sec_info
117 {
118         uint32 status;
119         
120 } REG_R_SET_KEY_SEC;
121
122
123 /* REG_Q_GET_KEY_SEC */
124 typedef struct q_reg_get_key_sec_info
125 {
126         POLICY_HND pol;         /* policy handle */
127
128         uint32 sec_info;       /* xxxx_SECURITY_INFORMATION */
129
130         uint32 ptr;       /* pointer */
131         BUFHDR hdr_sec;    /* header for security data */
132         SEC_DESC_BUF *data;    /* security data */
133         
134 } REG_Q_GET_KEY_SEC;
135
136 /* REG_R_GET_KEY_SEC */
137 typedef struct r_reg_get_key_sec_info
138 {
139         uint32 sec_info;       /* xxxx_SECURITY_INFORMATION */
140
141         uint32 ptr;       /* pointer */
142         BUFHDR hdr_sec;    /* header for security data */
143         SEC_DESC_BUF *data;    /* security data */
144
145         uint32 status;
146         
147 } REG_R_GET_KEY_SEC;
148
149 /* REG_Q_CREATE_VALUE */
150 typedef struct q_reg_create_value_info
151 {
152         POLICY_HND pol;    /* policy handle */
153
154         UNIHDR hdr_name;   /* name of value */
155         UNISTR2 uni_name;
156
157         uint32 type;       /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
158
159         BUFFER3 *buf_value; /* value, in byte buffer */
160
161 } REG_Q_CREATE_VALUE;
162
163 /* REG_R_CREATE_VALUE */
164 typedef struct r_reg_create_value_info
165
166         uint32 status;         /* return status */
167
168 } REG_R_CREATE_VALUE;
169
170 /* REG_Q_ENUM_VALUE */
171 typedef struct q_reg_query_value_info
172 {
173         POLICY_HND pol;    /* policy handle */
174
175         uint32 val_index;  /* index */
176
177         UNIHDR hdr_name;   /* name of value */
178         UNISTR2 uni_name;
179
180         uint32 ptr_type;   /* pointer */
181         uint32 type;       /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
182
183         uint32 ptr_value;  /* pointer */
184         BUFFER2 buf_value; /* value, in byte buffer */
185
186         uint32 ptr1;       /* pointer */
187         uint32 len_value1; /* */
188
189         uint32 ptr2;       /* pointer */
190         uint32 len_value2; /* */
191
192 } REG_Q_ENUM_VALUE;
193
194 /* REG_R_ENUM_VALUE */
195 typedef struct r_reg_enum_value_info
196
197         UNIHDR hdr_name;        /* name of value */
198         UNISTR2 uni_name;
199
200         uint32 ptr_type;            /* pointer */
201         uint32 type;        /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
202
203         uint32 ptr_value;       /* pointer */
204         BUFFER2 *buf_value;    /* value, in byte buffer */
205
206         uint32 ptr1;            /* pointer */
207         uint32 len_value1;       /* */
208
209         uint32 ptr2;            /* pointer */
210         uint32 len_value2;       /* */
211
212         uint32 status;         /* return status */
213
214 } REG_R_ENUM_VALUE;
215
216 /* REG_Q_CREATE_KEY */
217 typedef struct q_reg_create_key_info
218 {
219         POLICY_HND pnt_pol;       /* parent key policy handle */
220
221         UNIHDR hdr_name;
222         UNISTR2 uni_name;
223
224         UNIHDR hdr_class;
225         UNISTR2 uni_class;
226
227         uint32 reserved; /* 0x0000 0000 */
228         SEC_ACCESS sam_access; /* access rights flags, see rpc_secdes.h */
229
230         uint32 ptr1;
231         uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
232
233         uint32 ptr2;       /* pointer */
234         BUFHDR hdr_sec;    /* header for security data */
235         uint32 ptr3;       /* pointer */
236         SEC_DESC_BUF *data;
237
238         uint32 unknown_2; /* 0x0000 0000 */
239
240 } REG_Q_CREATE_KEY;
241
242 /* REG_R_CREATE_KEY */
243 typedef struct r_reg_create_key_info
244 {
245         POLICY_HND key_pol;       /* policy handle */
246         uint32 unknown; /* 0x0000 0000 */
247
248         uint32 status;         /* return status */
249
250 } REG_R_CREATE_KEY;
251
252 /* REG_Q_DELETE_KEY */
253 typedef struct q_reg_delete_key_info
254 {
255         POLICY_HND pnt_pol;       /* parent key policy handle */
256
257         UNIHDR hdr_name;
258         UNISTR2 uni_name;
259 } REG_Q_DELETE_KEY;
260
261 /* REG_R_DELETE_KEY */
262 typedef struct r_reg_delete_key_info
263 {
264         POLICY_HND key_pol;       /* policy handle */
265
266         uint32 status;         /* return status */
267
268 } REG_R_DELETE_KEY;
269
270 /* REG_Q_DELETE_VALUE */
271 typedef struct q_reg_delete_val_info
272 {
273         POLICY_HND pnt_pol;       /* parent key policy handle */
274
275         UNIHDR hdr_name;
276         UNISTR2 uni_name;
277
278 } REG_Q_DELETE_VALUE;
279
280 /* REG_R_DELETE_VALUE */
281 typedef struct r_reg_delete_val_info
282 {
283         POLICY_HND key_pol;       /* policy handle */
284
285         uint32 status;         /* return status */
286
287 } REG_R_DELETE_VALUE;
288
289 /* REG_Q_QUERY_KEY */
290 typedef struct q_reg_query_info
291 {
292         POLICY_HND pol;       /* policy handle */
293         UNIHDR hdr_class;
294         UNISTR2 uni_class;
295
296 } REG_Q_QUERY_KEY;
297
298 /* REG_R_QUERY_KEY */
299 typedef struct r_reg_query_key_info
300 {
301         UNIHDR hdr_class;
302         UNISTR2 uni_class;
303
304         uint32 num_subkeys;
305         uint32 max_subkeylen;
306         uint32 max_subkeysize; /* 0x0000 0000 */
307         uint32 num_values;
308         uint32 max_valnamelen;
309         uint32 max_valbufsize; 
310         uint32 sec_desc; /* 0x0000 0078 */
311         NTTIME mod_time;  /* modified time */
312
313         uint32 status;         /* return status */
314
315 } REG_R_QUERY_KEY;
316
317
318 /* REG_Q_UNK_1A */
319 typedef struct q_reg_unk_1a_info
320 {
321         POLICY_HND pol;       /* policy handle */
322
323 } REG_Q_UNK_1A;
324
325 /* REG_R_UNK_1A */
326 typedef struct r_reg_unk_1a_info
327 {
328         uint32 unknown;         /* 0x0500 0000 */
329         uint32 status;         /* return status */
330
331 } REG_R_UNK_1A;
332
333
334 /* REG_Q_CLOSE */
335 typedef struct reg_q_close_info
336 {
337         POLICY_HND pol; /* policy handle */
338
339 } REG_Q_CLOSE;
340
341 /* REG_R_CLOSE */
342 typedef struct reg_r_close_info
343 {
344         POLICY_HND pol; /* policy handle.  should be all zeros. */
345
346         uint32 status; /* return code */
347
348 } REG_R_CLOSE;
349
350
351 /* REG_Q_ENUM_KEY */
352 typedef struct q_reg_enum_value_info
353 {
354         POLICY_HND pol;         /* policy handle */
355
356         uint32 key_index;       
357
358         uint16 key_name_len;    /* 0x0000 */
359         uint16 unknown_1;       /* 0x0414 */
360
361         uint32 ptr1;            /* pointer */
362         uint32 unknown_2;       /* 0x0000 020A */
363         uint8  pad1[8];         /* padding - zeros */
364
365         uint32 ptr2;            /* pointer */
366         uint8  pad2[8];         /* padding - zeros */
367
368         uint32 ptr3;            /* pointer */
369         NTTIME time;            /* current time? */
370
371 } REG_Q_ENUM_KEY;
372
373 /* REG_R_ENUM_KEY */
374 typedef struct r_reg_enum_key_info
375
376         uint16 key_name_len;    /* number of bytes in key name */
377         uint16 unknown_1;       /* 0x0414 - matches with query unknown_1 */
378
379         uint32 ptr1;            /* pointer */
380         uint32 unknown_2;       /* 0x0000 020A */
381         uint32 unknown_3;       /* 0x0000 0000 */
382
383         UNISTR3 key_name;
384
385         uint32 ptr2;            /* pointer */
386         uint8  pad2[8];         /* padding - zeros */
387
388         uint32 ptr3;            /* pointer */
389         NTTIME time;            /* current time? */
390
391         uint32 status;         /* return status */
392
393 } REG_R_ENUM_KEY;
394
395
396 /* REG_Q_INFO */
397 typedef struct q_reg_info_info
398 {
399         POLICY_HND pol;        /* policy handle */
400
401         UNIHDR  hdr_type;       /* unicode product type header */
402         UNISTR2 uni_type;       /* unicode product type - "ProductType" */
403
404         uint32 ptr1;            /* pointer */
405         NTTIME time;            /* current time? */
406         uint8  major_version1;  /* 0x4 - os major version? */
407         uint8  minor_version1;  /* 0x1 - os minor version? */
408         uint8  pad1[10];        /* padding - zeros */
409
410         uint32 ptr2;            /* pointer */
411         uint8  major_version2;  /* 0x4 - os major version? */
412         uint8  minor_version2;  /* 0x1 - os minor version? */
413         uint8  pad2[2];         /* padding - zeros */
414
415         uint32 ptr3;            /* pointer */
416         uint32 unknown;         /* 0x0000 0000 */
417
418 } REG_Q_INFO;
419
420 /* REG_R_INFO */
421 typedef struct r_reg_info_info
422
423         uint32 ptr1;            /* buffer pointer */
424         uint32 level;          /* 0x1 - info level? */
425
426         uint32 ptr_type;       /* pointer to o/s type */
427         BUFFER2 uni_type;      /* unicode string o/s type - "LanmanNT" */
428
429         uint32 ptr2;           /* pointer to unknown_0 */
430         uint32 unknown_0;      /* 0x12 */
431
432         uint32 ptr3;           /* pointer to unknown_1 */
433         uint32 unknown_1;      /* 0x12 */
434
435         uint32 status;         /* return status */
436
437 } REG_R_INFO;
438
439
440 /* REG_Q_OPEN_ENTRY */
441 typedef struct q_reg_open_entry_info
442 {
443         POLICY_HND pol;        /* policy handle */
444
445         UNIHDR  hdr_name;       /* unicode registry string header */
446         UNISTR2 uni_name;       /* unicode registry string name */
447
448         uint32 unknown_0;       /* 32 bit unknown - 0x0000 0000 */
449         uint32 unknown_1;       /* 32 bit unknown - 0x0200 0000 */
450
451 } REG_Q_OPEN_ENTRY;
452
453
454
455 /* REG_R_OPEN_ENTRY */
456 typedef struct r_reg_open_entry_info
457 {
458         POLICY_HND pol;       /* policy handle */
459         uint32 status;         /* return status */
460
461 } REG_R_OPEN_ENTRY;
462
463
464
465 #endif /* _RPC_REG_H */
466