2 Unix SMB/Netbios implementation.
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 */
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
44 #define REG_CLOSE 0x05
46 #define HKEY_LOCAL_MACHINE 0x80000000
47 #define HKEY_USERS 0x80000003
50 typedef struct q_reg_open_policy_info
53 uint16 unknown_0
; /* 0xE084 - 16 bit unknown */
54 uint16 unknown_1
; /* random. changes */
55 uint32 level
; /* 0x0000 0002 - 32 bit unknown */
60 typedef struct r_reg_open_policy_info
62 POLICY_HND pol
; /* policy handle */
63 uint32 status
; /* return status */
69 typedef struct q_reg_open_unk4_info
72 uint16 unknown_0
; /* 0xE084 - 16 bit unknown */
73 uint16 unknown_1
; /* random. changes */
74 uint32 level
; /* 0x0000 0002 - 32 bit unknown */
79 typedef struct r_reg_open_unk4_info
81 POLICY_HND pol
; /* policy handle */
82 uint32 status
; /* return status */
88 typedef struct q_reg_open_flush_key_info
90 POLICY_HND pol
; /* policy handle */
95 typedef struct r_reg_open_flush_key_info
97 uint32 status
; /* return status */
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 */
115 /* REG_R_SET_KEY_SEC */
116 typedef struct r_reg_set_key_sec_info
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 */
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 */
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 */
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 */
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
; /* */
194 /* REG_R_ENUM_VALUE */
195 typedef struct r_reg_enum_value_info
197 UNIHDR hdr_name
; /* name of value */
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 */
216 /* REG_Q_CREATE_KEY */
217 typedef struct q_reg_create_key_info
219 POLICY_HND pnt_pol
; /* parent key policy handle */
227 uint32 reserved
; /* 0x0000 0000 */
228 SEC_ACCESS sam_access
; /* access rights flags, see rpc_secdes.h */
231 uint32 sec_info
; /* xxxx_SECURITY_INFORMATION */
233 uint32 ptr2
; /* pointer */
234 BUFHDR hdr_sec
; /* header for security data */
235 uint32 ptr3
; /* pointer */
238 uint32 unknown_2
; /* 0x0000 0000 */
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 */
252 /* REG_Q_DELETE_KEY */
253 typedef struct q_reg_delete_key_info
255 POLICY_HND pnt_pol
; /* parent key policy handle */
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 */
270 /* REG_Q_DELETE_VALUE */
271 typedef struct q_reg_delete_val_info
273 POLICY_HND pnt_pol
; /* parent key policy handle */
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 */
298 /* REG_R_QUERY_KEY */
299 typedef struct r_reg_query_key_info
305 uint32 max_subkeylen
;
306 uint32 max_subkeysize
; /* 0x0000 0000 */
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 */
319 typedef struct q_reg_unk_1a_info
321 POLICY_HND pol
; /* policy handle */
326 typedef struct r_reg_unk_1a_info
328 uint32 unknown
; /* 0x0500 0000 */
329 uint32 status
; /* return status */
335 typedef struct reg_q_close_info
337 POLICY_HND pol
; /* policy handle */
342 typedef struct reg_r_close_info
344 POLICY_HND pol
; /* policy handle. should be all zeros. */
346 uint32 status
; /* return code */
352 typedef struct q_reg_enum_value_info
354 POLICY_HND pol
; /* policy handle */
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? */
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 */
385 uint32 ptr2
; /* pointer */
386 uint8 pad2
[8]; /* padding - zeros */
388 uint32 ptr3
; /* pointer */
389 NTTIME time
; /* current time? */
391 uint32 status
; /* return status */
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" */
406 uint32 ptr_buf
; /* the next three fields follow if ptr_buf != 0 */
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 */
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 */
455 /* REG_R_OPEN_ENTRY */
456 typedef struct r_reg_open_entry_info
458 POLICY_HND pol
; /* policy handle */
459 uint32 status
; /* return status */
465 #endif /* _RPC_REG_H */