s3-registry: only include registry headers when really needed.
[amitay/samba.git] / source3 / include / registry.h
1 #include "reg_objects.h"
2
3 /* The following definitions come from registry/reg_api.c  */
4
5 WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive,
6                     uint32 desired_access,
7                     const struct nt_user_token *token,
8                     struct registry_key **pkey);
9 WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent,
10                    const char *name, uint32 desired_access,
11                    struct registry_key **pkey);
12 WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key,
13                    uint32 idx, char **name, NTTIME *last_write_time);
14 WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
15                      uint32 idx, char **pname, struct registry_value **pval);
16 WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
17                       const char *name, struct registry_value **pval);
18 WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys,
19                         uint32_t *max_subkeylen, uint32_t *max_subkeysize,
20                         uint32_t *num_values, uint32_t *max_valnamelen,
21                         uint32_t *max_valbufsize, uint32_t *secdescsize,
22                         NTTIME *last_changed_time);
23 WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
24                      const char *subkeypath, uint32 desired_access,
25                      struct registry_key **pkey,
26                      enum winreg_CreateAction *paction);
27 WERROR reg_deletekey(struct registry_key *parent, const char *path);
28 WERROR reg_setvalue(struct registry_key *key, const char *name,
29                     const struct registry_value *val);
30 WERROR reg_deletevalue(struct registry_key *key, const char *name);
31 WERROR reg_getkeysecurity(TALLOC_CTX *mem_ctx, struct registry_key *key,
32                           struct security_descriptor **psecdesc);
33 WERROR reg_setkeysecurity(struct registry_key *key,
34                           struct security_descriptor *psecdesc);
35 WERROR reg_getversion(uint32_t *version);
36 WERROR reg_restorekey(struct registry_key *key, const char *fname);
37 WERROR reg_savekey(struct registry_key *key, const char *fname);
38 WERROR reg_deleteallvalues(struct registry_key *key);
39 WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path,
40                      uint32 desired_access, const struct nt_user_token *token,
41                      struct registry_key **pkey);
42 WERROR reg_deletekey_recursive(TALLOC_CTX *ctx,
43                                struct registry_key *parent,
44                                const char *path);
45 WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx,
46                                    struct registry_key *parent,
47                                    const char *path);
48 WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path,
49                        uint32 desired_access,
50                        const struct nt_user_token *token,
51                        enum winreg_CreateAction *paction,
52                        struct registry_key **pkey);
53 WERROR reg_delete_path(const struct nt_user_token *token,
54                        const char *orig_path);
55
56 /* The following definitions come from registry/reg_backend_current_version.c  */
57
58
59 /* The following definitions come from registry/reg_backend_db.c  */
60
61 WERROR init_registry_key(const char *add_path);
62 WERROR init_registry_data(void);
63 WERROR regdb_init(void);
64 WERROR regdb_open( void );
65 int regdb_close( void );
66 WERROR regdb_transaction_start(void);
67 WERROR regdb_transaction_commit(void);
68 WERROR regdb_transaction_cancel(void);
69 int regdb_get_seqnum(void);
70 bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr);
71 int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr);
72 int regdb_fetch_values(const char* key, struct regval_ctr *values);
73 bool regdb_store_values(const char *key, struct regval_ctr *values);
74 bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys);
75 bool regdb_values_need_update(struct regval_ctr *values);
76
77 /* The following definitions come from registry/reg_backend_hkpt_params.c  */
78
79
80 /* The following definitions come from registry/reg_backend_netlogon_params.c  */
81
82
83 /* The following definitions come from registry/reg_backend_perflib.c  */
84
85
86 /* The following definitions come from registry/reg_backend_printing.c  */
87
88
89 /* The following definitions come from registry/reg_backend_prod_options.c  */
90
91
92 /* The following definitions come from registry/reg_backend_shares.c  */
93
94
95 /* The following definitions come from registry/reg_backend_smbconf.c  */
96
97
98 /* The following definitions come from registry/reg_backend_tcpip_params.c  */
99
100
101 /* The following definitions come from registry/reg_cachehook.c  */
102
103 WERROR reghook_cache_init(void);
104 WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops);
105 struct registry_ops *reghook_cache_find(const char *keyname);
106 void reghook_dump_cache( int debuglevel );
107
108 /* The following definitions come from registry/reg_dispatcher.c  */
109
110 bool store_reg_keys(struct registry_key_handle *key,
111                     struct regsubkey_ctr *subkeys);
112 bool store_reg_values(struct registry_key_handle *key, struct regval_ctr *val);
113 WERROR create_reg_subkey(struct registry_key_handle *key, const char *subkey);
114 WERROR delete_reg_subkey(struct registry_key_handle *key, const char *subkey);
115 int fetch_reg_keys(struct registry_key_handle *key,
116                    struct regsubkey_ctr *subkey_ctr);
117 int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val);
118 bool regkey_access_check(struct registry_key_handle *key, uint32 requested,
119                          uint32 *granted,
120                          const struct nt_user_token *token);
121 WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, struct registry_key_handle *key,
122                           struct security_descriptor **psecdesc);
123 WERROR regkey_set_secdesc(struct registry_key_handle *key,
124                           struct security_descriptor *psecdesc);
125 bool reg_subkeys_need_update(struct registry_key_handle *key,
126                              struct regsubkey_ctr *subkeys);
127 bool reg_values_need_update(struct registry_key_handle *key,
128                             struct regval_ctr *values);
129
130 /* The following definitions come from registry/reg_eventlog.c  */
131
132 bool eventlog_init_keys(void);
133 bool eventlog_add_source( const char *eventlog, const char *sourcename,
134                           const char *messagefile );
135
136 /* The following definitions come from registry/reg_init_basic.c  */
137
138 WERROR registry_init_common(void);
139 WERROR registry_init_basic(void);
140
141 /* The following definitions come from registry/reg_init_full.c  */
142
143 WERROR registry_init_full(void);
144
145 /* The following definitions come from registry/reg_init_smbconf.c  */
146
147 NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx,
148                                      NT_USER_TOKEN **ptoken);
149 WERROR registry_init_smbconf(const char *keyname);
150
151 /* The following definitions come from registry/reg_perfcount.c  */
152
153 void perfcount_init_keys( void );
154 uint32 reg_perfcount_get_base_index(void);
155 uint32 reg_perfcount_get_last_counter(uint32 base_index);
156 uint32 reg_perfcount_get_last_help(uint32 last_counter);
157 uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf);
158 uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf);
159 WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids);
160
161 /* The following definitions come from registry/reg_util.c  */
162
163 bool reg_split_path(char *path, char **base, char **new_path);
164 bool reg_split_key(char *path, char **base, char **key);
165 char *normalize_reg_path(TALLOC_CTX *ctx, const char *keyname );
166 void normalize_dbkey(char *key);
167 char *reg_remaining_path(TALLOC_CTX *ctx, const char *key);
168
169 /* The following definitions come from registry/reg_util_legacy.c  */
170
171 WERROR regkey_open_internal(TALLOC_CTX *ctx,
172                             struct registry_key_handle **regkey,
173                             const char *path,
174                             const struct nt_user_token *token,
175                             uint32 access_desired );
176
177 /* The following definitions come from registry/regfio.c  */
178
179 /* The following definitions come from lib/util_reg_api.c  */
180
181 WERROR registry_pull_value(TALLOC_CTX *mem_ctx,
182                            struct registry_value **pvalue,
183                            enum winreg_Type type, uint8 *data,
184                            uint32 size, uint32 length);
185 WERROR registry_push_value(TALLOC_CTX *mem_ctx,
186                            const struct registry_value *value,
187                            DATA_BLOB *presult);
188