registry modification requires a "sync" or "refresh" on the parent key.
[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_POLICY     0x02
30 #define REG_OPEN_UNK_4      0x04
31 #define REG_UNK_B           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_CREATE_VALUE    0x16
37 #define REG_GET_KEY_SEC     0x0c
38 #define REG_ENUM_VALUE      0x0a
39 #define REG_OPEN_ENTRY      0x0f
40 #define REG_INFO            0x11
41 #define REG_CLOSE           0x05
42
43
44 /* REG_Q_OPEN_POLICY */
45 typedef struct q_reg_open_policy_info
46 {
47         uint32 ptr;
48         uint16 unknown_0; /* 0xE084      - 16 bit unknown */
49         uint16 unknown_1; /* random.  changes */
50         uint32 level;     /* 0x0000 0002 - 32 bit unknown */
51
52 } REG_Q_OPEN_POLICY;
53
54 /* REG_R_OPEN_POLICY */
55 typedef struct r_reg_open_policy_info
56 {
57         POLICY_HND pol;       /* policy handle */
58         uint32 status;         /* return status */
59
60 } REG_R_OPEN_POLICY;
61
62
63 /* REG_Q_OPEN_UNK_4 */
64 typedef struct q_reg_open_unk4_info
65 {
66         uint32 ptr;
67         uint16 unknown_0; /* 0xE084      - 16 bit unknown */
68         uint16 unknown_1; /* random.  changes */
69         uint32 level;     /* 0x0000 0002 - 32 bit unknown */
70
71 } REG_Q_OPEN_UNK_4;
72
73 /* REG_R_OPEN_UNK_4 */
74 typedef struct r_reg_open_unk4_info
75 {
76         POLICY_HND pol;       /* policy handle */
77         uint32 status;         /* return status */
78
79 } REG_R_OPEN_UNK_4;
80
81
82 /* REG_Q_UNK_B */
83 typedef struct q_reg_open_unkb_info
84 {
85         POLICY_HND pol;       /* policy handle */
86
87 } REG_Q_UNK_B;
88
89 /* REG_R_UNK_B */
90 typedef struct r_reg_open_unkb_info
91 {
92         uint32 status;         /* return status */
93
94 } REG_R_UNK_B;
95
96
97 /* REG_Q_GET_KEY_SEC */
98 typedef struct q_reg_get_key_sec_info
99 {
100         POLICY_HND pol;         /* policy handle */
101
102         uint32 unknown;       /* 0x0000 0007 */
103
104         uint32 ptr;       /* pointer */
105         BUFHDR hdr_sec;    /* header for security data */
106         SEC_DESC_BUF *data;    /* security data */
107         
108 } REG_Q_GET_KEY_SEC;
109
110 /* REG_R_GET_KEY_SEC */
111 typedef struct r_reg_get_key_sec_info
112 {
113         uint32 unknown;       /* 0x0000 0007 */
114
115         uint32 ptr;       /* pointer */
116         BUFHDR hdr_sec;    /* header for security data */
117         SEC_DESC_BUF *data;    /* security data */
118
119         uint32 status;
120         
121 } REG_R_GET_KEY_SEC;
122
123 /* REG_Q_CREATE_VALUE */
124 typedef struct q_reg_create_value_info
125 {
126         POLICY_HND pol;    /* policy handle */
127
128         UNIHDR hdr_name;   /* name of value */
129         UNISTR2 uni_name;
130
131         uint32 type;       /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
132
133         BUFFER3 *buf_value; /* value, in byte buffer */
134
135 } REG_Q_CREATE_VALUE;
136
137 /* REG_R_CREATE_VALUE */
138 typedef struct r_reg_create_value_info
139
140         uint32 status;         /* return status */
141
142 } REG_R_CREATE_VALUE;
143
144 /* REG_Q_ENUM_VALUE */
145 typedef struct q_reg_query_value_info
146 {
147         POLICY_HND pol;    /* policy handle */
148
149         uint32 val_index;  /* index */
150
151         UNIHDR hdr_name;   /* name of value */
152         UNISTR2 uni_name;
153
154         uint32 ptr_type;   /* pointer */
155         uint32 type;       /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
156
157         uint32 ptr_value;  /* pointer */
158         BUFFER2 buf_value; /* value, in byte buffer */
159
160         uint32 ptr1;       /* pointer */
161         uint32 len_value1; /* */
162
163         uint32 ptr2;       /* pointer */
164         uint32 len_value2; /* */
165
166 } REG_Q_ENUM_VALUE;
167
168 /* REG_R_ENUM_VALUE */
169 typedef struct r_reg_enum_value_info
170
171         UNIHDR hdr_name;        /* name of value */
172         UNISTR2 uni_name;
173
174         uint32 ptr_type;            /* pointer */
175         uint32 type;        /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
176
177         uint32 ptr_value;       /* pointer */
178         BUFFER2 *buf_value;    /* value, in byte buffer */
179
180         uint32 ptr1;            /* pointer */
181         uint32 len_value1;       /* */
182
183         uint32 ptr2;            /* pointer */
184         uint32 len_value2;       /* */
185
186         uint32 status;         /* return status */
187
188 } REG_R_ENUM_VALUE;
189
190 /* REG_Q_CREATE_KEY */
191 typedef struct q_reg_create_key_info
192 {
193         POLICY_HND pnt_pol;       /* parent key policy handle */
194
195         UNIHDR hdr_name;
196         UNISTR2 uni_name;
197
198         UNIHDR hdr_class;
199         UNISTR2 uni_class;
200
201         uint32 reserved; /* 0x0000 0000 */
202         SEC_INFO sam_access; /* access rights flags, see rpc_secdes.h */
203
204         uint32 ptr1;
205         uint32 unknown_0; /* 0x0000 000C */
206
207         uint32 ptr2;
208         uint32 unk_len1; /* 0x0000 0014 */
209         uint32 unk_len2; /* 0x0000 0014 */
210         uint32 unknown_1; /* 0x0002 0000 */
211         BUFFER2 buf_unk;  /* 01 00 00 80   00 00 00 00   00 00 00 00   00 00 00 00   00 00 00 00  */
212
213         uint32 unknown_2; /* 0x0000 0000 */
214 } REG_Q_CREATE_KEY;
215
216 /* REG_R_CREATE_KEY */
217 typedef struct r_reg_create_key_info
218 {
219         POLICY_HND key_pol;       /* policy handle */
220         uint32 unknown; /* 0x0000 0000 */
221
222         uint32 status;         /* return status */
223
224 } REG_R_CREATE_KEY;
225
226 /* REG_Q_QUERY_KEY */
227 typedef struct q_reg_query_info
228 {
229         POLICY_HND pol;       /* policy handle */
230         UNIHDR hdr_class;
231         UNISTR2 uni_class;
232
233 } REG_Q_QUERY_KEY;
234
235 /* REG_R_QUERY_KEY */
236 typedef struct r_reg_query_key_info
237 {
238         UNIHDR hdr_class;
239         UNISTR2 uni_class;
240
241         uint32 num_subkeys;
242         uint32 max_subkeylen;
243         uint32 max_subkeysize; /* 0x0000 0000 */
244         uint32 num_values;
245         uint32 max_valnamelen;
246         uint32 max_valbufsize; 
247         uint32 sec_desc; /* 0x0000 0078 */
248         NTTIME mod_time;  /* modified time */
249
250         uint32 status;         /* return status */
251
252 } REG_R_QUERY_KEY;
253
254
255 /* REG_Q_UNK_1A */
256 typedef struct q_reg_unk_1a_info
257 {
258         POLICY_HND pol;       /* policy handle */
259
260 } REG_Q_UNK_1A;
261
262 /* REG_R_UNK_1A */
263 typedef struct r_reg_unk_1a_info
264 {
265         uint32 unknown;         /* 0x0500 0000 */
266         uint32 status;         /* return status */
267
268 } REG_R_UNK_1A;
269
270
271 /* REG_Q_CLOSE */
272 typedef struct reg_q_close_info
273 {
274         POLICY_HND pol; /* policy handle */
275
276 } REG_Q_CLOSE;
277
278 /* REG_R_CLOSE */
279 typedef struct reg_r_close_info
280 {
281         POLICY_HND pol; /* policy handle.  should be all zeros. */
282
283         uint32 status; /* return code */
284
285 } REG_R_CLOSE;
286
287
288 /* REG_Q_ENUM_KEY */
289 typedef struct q_reg_enum_value_info
290 {
291         POLICY_HND pol;         /* policy handle */
292
293         uint32 key_index;       
294
295         uint16 key_name_len;    /* 0x0000 */
296         uint16 unknown_1;       /* 0x0414 */
297
298         uint32 ptr1;            /* pointer */
299         uint32 unknown_2;       /* 0x0000 020A */
300         uint8  pad1[8];         /* padding - zeros */
301
302         uint32 ptr2;            /* pointer */
303         uint8  pad2[8];         /* padding - zeros */
304
305         uint32 ptr3;            /* pointer */
306         NTTIME time;            /* current time? */
307
308 } REG_Q_ENUM_KEY;
309
310 /* REG_R_ENUM_KEY */
311 typedef struct r_reg_enum_key_info
312
313         uint16 key_name_len;    /* number of bytes in key name */
314         uint16 unknown_1;       /* 0x0414 - matches with query unknown_1 */
315
316         uint32 ptr1;            /* pointer */
317         uint32 unknown_2;       /* 0x0000 020A */
318         uint32 unknown_3;       /* 0x0000 0000 */
319
320         UNISTR3 key_name;
321
322         uint32 ptr2;            /* pointer */
323         uint8  pad2[8];         /* padding - zeros */
324
325         uint32 ptr3;            /* pointer */
326         NTTIME time;            /* current time? */
327
328         uint32 status;         /* return status */
329
330 } REG_R_ENUM_KEY;
331
332
333 /* REG_Q_INFO */
334 typedef struct q_reg_info_info
335 {
336         POLICY_HND pol;        /* policy handle */
337
338         UNIHDR  hdr_type;       /* unicode product type header */
339         UNISTR2 uni_type;       /* unicode product type - "ProductType" */
340
341         uint32 ptr1;            /* pointer */
342         NTTIME time;            /* current time? */
343         uint8  major_version1;  /* 0x4 - os major version? */
344         uint8  minor_version1;  /* 0x1 - os minor version? */
345         uint8  pad1[10];        /* padding - zeros */
346
347         uint32 ptr2;            /* pointer */
348         uint8  major_version2;  /* 0x4 - os major version? */
349         uint8  minor_version2;  /* 0x1 - os minor version? */
350         uint8  pad2[2];         /* padding - zeros */
351
352         uint32 ptr3;            /* pointer */
353         uint32 unknown;         /* 0x0000 0000 */
354
355 } REG_Q_INFO;
356
357 /* REG_R_INFO */
358 typedef struct r_reg_info_info
359
360         uint32 ptr1;            /* buffer pointer */
361         uint32 level;          /* 0x1 - info level? */
362
363         uint32 ptr_type;       /* pointer to o/s type */
364         BUFFER2 uni_type;      /* unicode string o/s type - "LanmanNT" */
365
366         uint32 ptr2;           /* pointer to unknown_0 */
367         uint32 unknown_0;      /* 0x12 */
368
369         uint32 ptr3;           /* pointer to unknown_1 */
370         uint32 unknown_1;      /* 0x12 */
371
372         uint32 status;         /* return status */
373
374 } REG_R_INFO;
375
376
377 /* REG_Q_OPEN_ENTRY */
378 typedef struct q_reg_open_entry_info
379 {
380         POLICY_HND pol;        /* policy handle */
381
382         UNIHDR  hdr_name;       /* unicode registry string header */
383         UNISTR2 uni_name;       /* unicode registry string name */
384
385         uint32 unknown_0;       /* 32 bit unknown - 0x0000 0000 */
386         uint32 unknown_1;       /* 32 bit unknown - 0x0200 0000 */
387
388 } REG_Q_OPEN_ENTRY;
389
390
391
392 /* REG_R_OPEN_ENTRY */
393 typedef struct r_reg_open_entry_info
394 {
395         POLICY_HND pol;       /* policy handle */
396         uint32 status;         /* return status */
397
398 } REG_R_OPEN_ENTRY;
399
400
401
402 #endif /* _RPC_REG_H */
403