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