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 */
28 #include "reg_objects.h"
32 #define REG_OPEN_HKCR 0x00
33 #define REG_OPEN_HKLM 0x02
34 #define REG_OPEN_HKPD 0x03
35 #define REG_OPEN_HKU 0x04
36 #define REG_CLOSE 0x05
37 #define REG_CREATE_KEY 0x06
38 #define REG_DELETE_KEY 0x07
39 #define REG_DELETE_VALUE 0x08
40 #define REG_ENUM_KEY 0x09
41 #define REG_ENUM_VALUE 0x0a
42 #define REG_FLUSH_KEY 0x0b
43 #define REG_GET_KEY_SEC 0x0c
44 #define REG_OPEN_ENTRY 0x0f
45 #define REG_QUERY_KEY 0x10
47 #define REG_RESTORE_KEY 0x13
48 #define REG_SAVE_KEY 0x14
49 #define REG_SET_KEY_SEC 0x15
50 #define REG_SET_VALUE 0x16
51 #define REG_SHUTDOWN 0x18
52 #define REG_ABORT_SHUTDOWN 0x19
53 #define REG_GETVERSION 0x1a
54 #define REG_SHUTDOWN_EX 0x1e
57 #define HKEY_CLASSES_ROOT 0x80000000
58 #define HKEY_CURRENT_USER 0x80000001
59 #define HKEY_LOCAL_MACHINE 0x80000002
60 #define HKEY_USERS 0x80000003
61 #define HKEY_PERFORMANCE_DATA 0x80000004
63 #define KEY_HKLM "HKLM"
65 #define KEY_HKCR "HKCR"
66 #define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print"
67 #define KEY_PRINTING_2K "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print"
68 #define KEY_PRINTING_PORTS "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports"
69 #define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog"
70 #define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares"
71 #define KEY_TREE_ROOT ""
73 /* Registry data types */
77 #define REG_EXPAND_SZ 2
80 #define REG_DWORD_LE 4 /* DWORD, little endian */
81 #define REG_DWORD_BE 5 /* DWORD, big endian */
83 #define REG_MULTI_SZ 7
84 #define REG_RESOURCE_LIST 8
85 #define REG_FULL_RESOURCE_DESCRIPTOR 9
86 #define REG_RESOURCE_REQUIREMENTS_LIST 10
89 * container for function pointers to enumeration routines
90 * for vitural registry view
94 /* functions for enumerating subkeys and values */
95 int (*fetch_subkeys)( char *key, REGSUBKEY_CTR *subkeys);
96 int (*fetch_values) ( char *key, REGVAL_CTR *val );
97 BOOL (*store_subkeys)( char *key, REGSUBKEY_CTR *subkeys );
98 BOOL (*store_values)( char *key, REGVAL_CTR *val );
99 BOOL (*reg_access_check)( uint32 parent_granted, uint32 requested, uint32 *granted );
103 const char *keyname; /* full path to name of key */
104 REGISTRY_OPS *ops; /* registry function hooks */
108 /* structure to store the registry handles */
110 typedef struct _RegistryKey {
112 struct _RegistryKey *prev, *next;
114 /* POLICY_HND hnd; */
115 pstring name; /* full name of registry key */
121 * RPC REGISTRY STRUCTURES
124 /***********************************************/
137 /***********************************************/
148 /***********************************************/
163 /***********************************************/
181 /***********************************************/
195 /***********************************************/
202 REGVAL_BUFFER *value; /* value, in byte buffer */
210 REGVAL_BUFFER *value;
216 /***********************************************/
229 uint32 unknown_2; /* 0x0000 0000 */
238 /***********************************************/
250 /***********************************************/
255 } REG_Q_DELETE_VALUE;
260 } REG_R_DELETE_VALUE;
262 /***********************************************/
272 uint32 max_subkeylen;
273 uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */
275 uint32 max_valnamelen;
276 uint32 max_valbufsize;
277 uint32 sec_desc; /* 0x0000 0078 */
278 NTTIME mod_time; /* modified time */
283 /***********************************************/
295 /***********************************************/
304 WERROR status; /* return status */
308 /***********************************************/
311 /* I have no idea if this is correct since I
312 have not seen the full structure on the wire
322 uint32 size; /* size in bytes of security descriptor */
323 REG_SEC_DESC_BUF secdesc;
324 uint8 inherit; /* see MSDN for a description */
325 } SECURITY_ATTRIBUTE;
330 SECURITY_ATTRIBUTE *sec_attr;
334 WERROR status; /* return status */
338 /***********************************************/
341 POLICY_HND pol; /* policy handle */
350 /***********************************************/
356 uint16 unknown_1; /* 0x0414 */
358 uint32 unknown_2; /* 0x0000 020A */
370 WERROR status; /* return status */
374 /***********************************************/
377 POLICY_HND pol; /* policy handle */
380 uint32 ptr_reserved; /* pointer */
382 uint32 ptr_buf; /* the next three fields follow if ptr_buf != 0 */
398 REGVAL_BUFFER *value; /* key value */
401 WERROR status; /* return status */
405 /***********************************************/
410 uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */
419 /***********************************************/
424 uint32 timeout; /* in seconds */
425 uint8 force; /* boolean: force shutdown */
426 uint8 reboot; /* boolean: reboot on shutdown */
430 WERROR status; /* return status */
433 /***********************************************/
438 uint32 timeout; /* in seconds */
439 uint8 force; /* boolean: force shutdown */
440 uint8 reboot; /* boolean: reboot on shutdown */
441 uint32 reason; /* reason - must be defined code */
448 /***********************************************/
452 } REG_Q_ABORT_SHUTDOWN;
456 } REG_R_ABORT_SHUTDOWN;
459 #endif /* _RPC_REG_H */