- sorry, forgot to check a pointer
[Samba.git] / source / include / rpc_reg.h
blob103a7492cd0b5c16d8a48b52caa54e0a79bc6da1
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
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.
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.
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.
24 #ifndef _RPC_REG_H /* _RPC_REG_H */
25 #define _RPC_REG_H
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
46 #define HKEY_LOCAL_MACHINE 0x80000000
47 #define HKEY_USERS 0x80000003
49 /* REG_Q_OPEN_HKLM */
50 typedef struct q_reg_open_policy_info
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 */
57 } REG_Q_OPEN_HKLM ;
59 /* REG_R_OPEN_HKLM */
60 typedef struct r_reg_open_policy_info
62 POLICY_HND pol; /* policy handle */
63 uint32 status; /* return status */
65 } REG_R_OPEN_HKLM;
68 /* REG_Q_OPEN_HKU */
69 typedef struct q_reg_open_unk4_info
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 */
76 } REG_Q_OPEN_HKU;
78 /* REG_R_OPEN_HKU */
79 typedef struct r_reg_open_unk4_info
81 POLICY_HND pol; /* policy handle */
82 uint32 status; /* return status */
84 } REG_R_OPEN_HKU;
87 /* REG_Q_FLUSH_KEY */
88 typedef struct q_reg_open_flush_key_info
90 POLICY_HND pol; /* policy handle */
92 } REG_Q_FLUSH_KEY;
94 /* REG_R_FLUSH_KEY */
95 typedef struct r_reg_open_flush_key_info
97 uint32 status; /* return status */
99 } REG_R_FLUSH_KEY;
102 /* REG_Q_SET_KEY_SEC */
103 typedef struct q_reg_set_key_sec_info
105 POLICY_HND pol; /* policy handle */
107 uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
109 uint32 ptr; /* pointer */
110 BUFHDR hdr_sec; /* header for security data */
111 SEC_DESC_BUF *data; /* security data */
113 } REG_Q_SET_KEY_SEC;
115 /* REG_R_SET_KEY_SEC */
116 typedef struct r_reg_set_key_sec_info
118 uint32 status;
120 } REG_R_SET_KEY_SEC;
123 /* REG_Q_GET_KEY_SEC */
124 typedef struct q_reg_get_key_sec_info
126 POLICY_HND pol; /* policy handle */
128 uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
130 uint32 ptr; /* pointer */
131 BUFHDR hdr_sec; /* header for security data */
132 SEC_DESC_BUF *data; /* security data */
134 } REG_Q_GET_KEY_SEC;
136 /* REG_R_GET_KEY_SEC */
137 typedef struct r_reg_get_key_sec_info
139 uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
141 uint32 ptr; /* pointer */
142 BUFHDR hdr_sec; /* header for security data */
143 SEC_DESC_BUF *data; /* security data */
145 uint32 status;
147 } REG_R_GET_KEY_SEC;
149 /* REG_Q_CREATE_VALUE */
150 typedef struct q_reg_create_value_info
152 POLICY_HND pol; /* policy handle */
154 UNIHDR hdr_name; /* name of value */
155 UNISTR2 uni_name;
157 uint32 type; /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
159 BUFFER3 *buf_value; /* value, in byte buffer */
161 } REG_Q_CREATE_VALUE;
163 /* REG_R_CREATE_VALUE */
164 typedef struct r_reg_create_value_info
166 uint32 status; /* return status */
168 } REG_R_CREATE_VALUE;
170 /* REG_Q_ENUM_VALUE */
171 typedef struct q_reg_query_value_info
173 POLICY_HND pol; /* policy handle */
175 uint32 val_index; /* index */
177 UNIHDR hdr_name; /* name of value */
178 UNISTR2 uni_name;
180 uint32 ptr_type; /* pointer */
181 uint32 type; /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
183 uint32 ptr_value; /* pointer */
184 BUFFER2 buf_value; /* value, in byte buffer */
186 uint32 ptr1; /* pointer */
187 uint32 len_value1; /* */
189 uint32 ptr2; /* pointer */
190 uint32 len_value2; /* */
192 } REG_Q_ENUM_VALUE;
194 /* REG_R_ENUM_VALUE */
195 typedef struct r_reg_enum_value_info
197 UNIHDR hdr_name; /* name of value */
198 UNISTR2 uni_name;
200 uint32 ptr_type; /* pointer */
201 uint32 type; /* 1 = UNISTR, 3 = BYTES, 4 = DWORD, 7 = MULTI_UNISTR */
203 uint32 ptr_value; /* pointer */
204 BUFFER2 *buf_value; /* value, in byte buffer */
206 uint32 ptr1; /* pointer */
207 uint32 len_value1; /* */
209 uint32 ptr2; /* pointer */
210 uint32 len_value2; /* */
212 uint32 status; /* return status */
214 } REG_R_ENUM_VALUE;
216 /* REG_Q_CREATE_KEY */
217 typedef struct q_reg_create_key_info
219 POLICY_HND pnt_pol; /* parent key policy handle */
221 UNIHDR hdr_name;
222 UNISTR2 uni_name;
224 UNIHDR hdr_class;
225 UNISTR2 uni_class;
227 uint32 reserved; /* 0x0000 0000 */
228 SEC_ACCESS sam_access; /* access rights flags, see rpc_secdes.h */
230 uint32 ptr1;
231 uint32 sec_info; /* xxxx_SECURITY_INFORMATION */
233 uint32 ptr2; /* pointer */
234 BUFHDR hdr_sec; /* header for security data */
235 uint32 ptr3; /* pointer */
236 SEC_DESC_BUF *data;
238 uint32 unknown_2; /* 0x0000 0000 */
240 } REG_Q_CREATE_KEY;
242 /* REG_R_CREATE_KEY */
243 typedef struct r_reg_create_key_info
245 POLICY_HND key_pol; /* policy handle */
246 uint32 unknown; /* 0x0000 0000 */
248 uint32 status; /* return status */
250 } REG_R_CREATE_KEY;
252 /* REG_Q_DELETE_KEY */
253 typedef struct q_reg_delete_key_info
255 POLICY_HND pnt_pol; /* parent key policy handle */
257 UNIHDR hdr_name;
258 UNISTR2 uni_name;
259 } REG_Q_DELETE_KEY;
261 /* REG_R_DELETE_KEY */
262 typedef struct r_reg_delete_key_info
264 POLICY_HND key_pol; /* policy handle */
266 uint32 status; /* return status */
268 } REG_R_DELETE_KEY;
270 /* REG_Q_DELETE_VALUE */
271 typedef struct q_reg_delete_val_info
273 POLICY_HND pnt_pol; /* parent key policy handle */
275 UNIHDR hdr_name;
276 UNISTR2 uni_name;
278 } REG_Q_DELETE_VALUE;
280 /* REG_R_DELETE_VALUE */
281 typedef struct r_reg_delete_val_info
283 POLICY_HND key_pol; /* policy handle */
285 uint32 status; /* return status */
287 } REG_R_DELETE_VALUE;
289 /* REG_Q_QUERY_KEY */
290 typedef struct q_reg_query_info
292 POLICY_HND pol; /* policy handle */
293 UNIHDR hdr_class;
294 UNISTR2 uni_class;
296 } REG_Q_QUERY_KEY;
298 /* REG_R_QUERY_KEY */
299 typedef struct r_reg_query_key_info
301 UNIHDR hdr_class;
302 UNISTR2 uni_class;
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 */
313 uint32 status; /* return status */
315 } REG_R_QUERY_KEY;
318 /* REG_Q_UNK_1A */
319 typedef struct q_reg_unk_1a_info
321 POLICY_HND pol; /* policy handle */
323 } REG_Q_UNK_1A;
325 /* REG_R_UNK_1A */
326 typedef struct r_reg_unk_1a_info
328 uint32 unknown; /* 0x0500 0000 */
329 uint32 status; /* return status */
331 } REG_R_UNK_1A;
334 /* REG_Q_CLOSE */
335 typedef struct reg_q_close_info
337 POLICY_HND pol; /* policy handle */
339 } REG_Q_CLOSE;
341 /* REG_R_CLOSE */
342 typedef struct reg_r_close_info
344 POLICY_HND pol; /* policy handle. should be all zeros. */
346 uint32 status; /* return code */
348 } REG_R_CLOSE;
351 /* REG_Q_ENUM_KEY */
352 typedef struct q_reg_enum_value_info
354 POLICY_HND pol; /* policy handle */
356 uint32 key_index;
358 uint16 key_name_len; /* 0x0000 */
359 uint16 unknown_1; /* 0x0414 */
361 uint32 ptr1; /* pointer */
362 uint32 unknown_2; /* 0x0000 020A */
363 uint8 pad1[8]; /* padding - zeros */
365 uint32 ptr2; /* pointer */
366 uint8 pad2[8]; /* padding - zeros */
368 uint32 ptr3; /* pointer */
369 NTTIME time; /* current time? */
371 } REG_Q_ENUM_KEY;
373 /* REG_R_ENUM_KEY */
374 typedef struct r_reg_enum_key_info
376 uint16 key_name_len; /* number of bytes in key name */
377 uint16 unknown_1; /* 0x0414 - matches with query unknown_1 */
379 uint32 ptr1; /* pointer */
380 uint32 unknown_2; /* 0x0000 020A */
381 uint32 unknown_3; /* 0x0000 0000 */
383 UNISTR3 key_name;
385 uint32 ptr2; /* pointer */
386 uint8 pad2[8]; /* padding - zeros */
388 uint32 ptr3; /* pointer */
389 NTTIME time; /* current time? */
391 uint32 status; /* return status */
393 } REG_R_ENUM_KEY;
396 /* REG_Q_INFO */
397 typedef struct q_reg_info_info
399 POLICY_HND pol; /* policy handle */
401 UNIHDR hdr_type; /* unicode product type header */
402 UNISTR2 uni_type; /* unicode product type - "ProductType" */
404 uint32 ptr_reserved;
406 uint32 ptr_buf; /* the next three fields follow if ptr_buf != 0 */
407 uint32 ptr_bufsize;
408 uint32 bufsize;
409 uint32 buf_unk;
411 uint32 unk1;
412 uint32 ptr_buflen;
413 uint32 buflen;
415 uint32 ptr_buflen2;
416 uint32 buflen2;
418 } REG_Q_INFO;
420 /* REG_R_INFO */
421 typedef struct r_reg_info_info
423 uint32 ptr_type; /* keyvalue pointer */
424 uint32 type; /* keyvalue datatype */
426 uint32 ptr_uni_val; /* pointer to o/s type */
427 BUFFER2 *uni_val; /* unicode string o/s type - "LanmanNT" */
429 uint32 ptr_max_len; /* pointer to unknown_0 */
430 uint32 buf_max_len; /* 0x12 */
432 uint32 ptr_len; /* pointer to unknown_1 */
433 uint32 buf_len; /* 0x12 */
435 uint32 status; /* return status */
437 } REG_R_INFO;
440 /* REG_Q_OPEN_ENTRY */
441 typedef struct q_reg_open_entry_info
443 POLICY_HND pol; /* policy handle */
445 UNIHDR hdr_name; /* unicode registry string header */
446 UNISTR2 uni_name; /* unicode registry string name */
448 uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */
449 uint32 unknown_1; /* 32 bit unknown - 0x0200 0000 */
451 } REG_Q_OPEN_ENTRY;
455 /* REG_R_OPEN_ENTRY */
456 typedef struct r_reg_open_entry_info
458 POLICY_HND pol; /* policy handle */
459 uint32 status; /* return status */
461 } REG_R_OPEN_ENTRY;
465 #endif /* _RPC_REG_H */