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 Copyright (C) Jeremy Cooper 2004.
8 Copyright (C) Gerald Carter 2002-2005.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #ifndef _RPC_REG_H /* _RPC_REG_H */
30 #define REG_OPEN_HKCR 0x00
31 #define REG_OPEN_HKLM 0x02
32 #define REG_OPEN_HKPD 0x03
33 #define REG_OPEN_HKU 0x04
34 #define REG_CLOSE 0x05
35 #define REG_CREATE_KEY 0x06
36 #define REG_DELETE_KEY 0x07
37 #define REG_DELETE_VALUE 0x08
38 #define REG_ENUM_KEY 0x09
39 #define REG_ENUM_VALUE 0x0a
40 #define REG_FLUSH_KEY 0x0b
41 #define REG_GET_KEY_SEC 0x0c
42 #define REG_OPEN_ENTRY 0x0f
43 #define REG_QUERY_KEY 0x10
45 #define REG_RESTORE_KEY 0x13
46 #define REG_SAVE_KEY 0x14
47 #define REG_SET_KEY_SEC 0x15
48 #define REG_SET_VALUE 0x16
49 #define REG_SHUTDOWN 0x18
50 #define REG_ABORT_SHUTDOWN 0x19
51 #define REG_GETVERSION 0x1a
52 #define REG_SHUTDOWN_EX 0x1e
55 #define HKEY_CLASSES_ROOT 0x80000000
56 #define HKEY_CURRENT_USER 0x80000001
57 #define HKEY_LOCAL_MACHINE 0x80000002
58 #define HKEY_USERS 0x80000003
59 #define HKEY_PERFORMANCE_DATA 0x80000004
61 #define KEY_HKLM "HKLM"
63 #define KEY_HKCR "HKCR"
64 #define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print"
65 #define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog"
66 #define KEY_TREE_ROOT ""
68 /* Registry data types */
72 #define REG_EXPAND_SZ 2
75 #define REG_DWORD_LE 4 /* DWORD, little endian */
76 #define REG_DWORD_BE 5 /* DWORD, big endian */
78 #define REG_MULTI_SZ 7
79 #define REG_RESOURCE_LIST 8
80 #define REG_FULL_RESOURCE_DESCRIPTOR 9
81 #define REG_RESOURCE_REQUIREMENTS_LIST 10
84 * INTERNAL REGISTRY STRUCTURES
87 /* structure to contain registry values */
92 uint32 size
; /* in bytes */
96 /* container for registry values */
101 REGISTRY_VALUE
**values
;
104 /* container for registry subkey names */
114 * container for function pointers to enumeration routines
115 * for vitural registry view
119 /* functions for enumerating subkeys and values */
120 int (*subkey_fn
)( char *key
, REGSUBKEY_CTR
*subkeys
);
121 int (*value_fn
) ( char *key
, REGVAL_CTR
*val
);
122 BOOL (*store_subkeys_fn
)( char *key
, REGSUBKEY_CTR
*subkeys
);
123 BOOL (*store_values_fn
)( char *key
, REGVAL_CTR
*val
);
127 const char *keyname
; /* full path to name of key */
128 REGISTRY_OPS
*ops
; /* registry function hooks */
133 /* structure to store the registry handles */
135 typedef struct _RegistryKey
{
137 struct _RegistryKey
*prev
, *next
;
140 pstring name
; /* full name of registry key */
146 * RPC REGISTRY STRUCTURES
149 /***********************************************/
162 /***********************************************/
173 /***********************************************/
188 /***********************************************/
206 /***********************************************/
220 /***********************************************/
227 REGVAL_BUFFER
*value
; /* value, in byte buffer */
235 REGVAL_BUFFER
*value
;
241 /***********************************************/
254 uint32 unknown_2
; /* 0x0000 0000 */
263 /***********************************************/
275 /***********************************************/
280 } REG_Q_DELETE_VALUE
;
285 } REG_R_DELETE_VALUE
;
287 /***********************************************/
297 uint32 max_subkeylen
;
298 uint32 reserved
; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */
300 uint32 max_valnamelen
;
301 uint32 max_valbufsize
;
302 uint32 sec_desc
; /* 0x0000 0078 */
303 NTTIME mod_time
; /* modified time */
308 /***********************************************/
311 POLICY_HND pol
; /* policy handle */
315 uint32 unknown
; /* 0x0500 0000 */
316 WERROR status
; /* return status */
320 /***********************************************/
329 WERROR status
; /* return status */
333 /***********************************************/
336 /* I have no idea if this is correct since I
337 have not seen the full structure on the wire
347 uint32 size
; /* size in bytes of security descriptor */
348 REG_SEC_DESC_BUF secdesc
;
349 uint8 inherit
; /* see MSDN for a description */
350 } SECURITY_ATTRIBUTE
;
355 SECURITY_ATTRIBUTE
*sec_attr
;
359 WERROR status
; /* return status */
363 /***********************************************/
366 POLICY_HND pol
; /* policy handle */
375 /***********************************************/
380 uint16 key_name_len
; /* 0x0000 */
381 uint16 unknown_1
; /* 0x0414 */
382 uint32 ptr1
; /* pointer */
383 uint32 unknown_2
; /* 0x0000 020A */
384 uint8 pad1
[8]; /* padding - zeros */
385 uint32 ptr2
; /* pointer */
386 uint8 pad2
[8]; /* padding - zeros */
387 uint32 ptr3
; /* pointer */
388 NTTIME time
; /* current time? */
392 uint16 key_name_len
; /* number of bytes in key name */
393 uint16 unknown_1
; /* 0x0414 - matches with query unknown_1 */
395 uint32 ptr1
; /* pointer */
396 uint32 unknown_2
; /* 0x0000 020A */
397 uint32 unknown_3
; /* 0x0000 0000 */
401 uint32 ptr2
; /* pointer */
402 uint8 pad2
[8]; /* padding - zeros */
404 uint32 ptr3
; /* pointer */
405 NTTIME time
; /* current time? */
407 WERROR status
; /* return status */
411 /***********************************************/
414 POLICY_HND pol
; /* policy handle */
417 uint32 ptr_reserved
; /* pointer */
419 uint32 ptr_buf
; /* the next three fields follow if ptr_buf != 0 */
435 REGVAL_BUFFER
*value
; /* key value */
438 WERROR status
; /* return status */
442 /***********************************************/
447 uint32 unknown_0
; /* 32 bit unknown - 0x0000 0000 */
456 /***********************************************/
461 uint32 timeout
; /* in seconds */
462 uint8 force
; /* boolean: force shutdown */
463 uint8 reboot
; /* boolean: reboot on shutdown */
467 WERROR status
; /* return status */
470 /***********************************************/
475 uint32 timeout
; /* in seconds */
476 uint8 force
; /* boolean: force shutdown */
477 uint8 reboot
; /* boolean: reboot on shutdown */
478 uint32 reason
; /* reason - must be defined code */
485 /***********************************************/
489 } REG_Q_ABORT_SHUTDOWN
;
493 } REG_R_ABORT_SHUTDOWN
;
496 #endif /* _RPC_REG_H */