From fe31b67d5e9bf5b6c195eddb5f7b42e680a0f36a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 2 Oct 2009 00:17:06 +0200 Subject: s3-registry: only include registry headers when really needed. Guenther --- libgpo/gpext/gpext.c | 1 + source3/include/includes.h | 2 - source3/include/proto.h | 221 ------------------------- source3/include/reg_objects.h | 36 ++++ source3/include/regfio.h | 2 + source3/include/registry.h | 188 +++++++++++++++++++++ source3/lib/smbconf/smbconf_reg.c | 1 + source3/lib/util_reg_api.c | 1 + source3/libads/ldap_printer.c | 1 + source3/libgpo/gpext/registry.c | 1 + source3/libgpo/gpext/scripts.c | 1 + source3/libgpo/gpo_reg.c | 1 + source3/printing/nt_printing.c | 1 + source3/registry/reg_api.c | 1 + source3/registry/reg_backend_current_version.c | 1 + source3/registry/reg_backend_db.c | 2 + source3/registry/reg_backend_hkpt_params.c | 1 + source3/registry/reg_backend_netlogon_params.c | 1 + source3/registry/reg_backend_perflib.c | 1 + source3/registry/reg_backend_printing.c | 1 + source3/registry/reg_backend_prod_options.c | 1 + source3/registry/reg_backend_shares.c | 1 + source3/registry/reg_backend_smbconf.c | 1 + source3/registry/reg_backend_tcpip_params.c | 1 + source3/registry/reg_cachehook.c | 1 + source3/registry/reg_dispatcher.c | 1 + source3/registry/reg_eventlog.c | 1 + source3/registry/reg_init_basic.c | 1 + source3/registry/reg_init_full.c | 1 + source3/registry/reg_init_smbconf.c | 1 + source3/registry/reg_objects.c | 1 + source3/registry/reg_perfcount.c | 1 + source3/registry/reg_util.c | 1 + source3/registry/reg_util_legacy.c | 1 + source3/registry/regfio.c | 1 + source3/rpc_server/srv_eventlog_nt.c | 1 + source3/rpc_server/srv_ntsvcs_nt.c | 1 + source3/rpc_server/srv_spoolss_nt.c | 1 + source3/rpc_server/srv_svcctl_nt.c | 1 + source3/rpc_server/srv_winreg_nt.c | 1 + source3/rpcclient/cmd_spoolss.c | 1 + source3/services/services_db.c | 1 + source3/smbd/server.c | 1 + source3/utils/eventlogadm.c | 1 + source3/utils/net_registry.c | 2 +- source3/utils/net_registry_util.c | 1 + source3/utils/net_rpc_printer.c | 1 + source3/utils/net_rpc_registry.c | 2 +- source3/utils/profiles.c | 1 + 49 files changed, 271 insertions(+), 225 deletions(-) create mode 100644 source3/include/registry.h diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c index 5465774eb1..865a725c7b 100644 --- a/libgpo/gpext/gpext.c +++ b/libgpo/gpext/gpext.c @@ -24,6 +24,7 @@ #include "lib/util/dlinklist.h" #if _SAMBA_BUILD_ == 3 #include "libgpo/gpo_proto.h" +#include "registry.h" #endif static struct gp_extension *extensions = NULL; diff --git a/source3/include/includes.h b/source3/include/includes.h index 07b31c2406..20a52e6e5d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -656,8 +656,6 @@ struct ntlmssp_state; #include "auth.h" #include "ntdomain.h" -#include "reg_objects.h" -#include "reg_db.h" #include "librpc/gen_ndr/ndr_nbt.h" #include "librpc/rpc/dcerpc.h" #include "nt_printing.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index 8735b9aa78..53f76545bf 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1303,16 +1303,6 @@ bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, const DATA_BLOB *blob, const char ***a); -/* The following definitions come from lib/util_reg_api.c */ - -WERROR registry_pull_value(TALLOC_CTX *mem_ctx, - struct registry_value **pvalue, - enum winreg_Type type, uint8 *data, - uint32 size, uint32 length); -WERROR registry_push_value(TALLOC_CTX *mem_ctx, - const struct registry_value *value, - DATA_BLOB *presult); - /* The following definitions come from lib/util_seaccess.c */ void se_map_generic(uint32 *access_mask, const struct generic_mapping *mapping); @@ -4878,217 +4868,6 @@ TDB_DATA get_printer_notify_pid_list(TDB_CONTEXT *tdb, const char *printer_name, void set_profile_level(int level, struct server_id src); bool profile_setup(struct messaging_context *msg_ctx, bool rdonly); -/* The following definitions come from registry/reg_api.c */ - -WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive, - uint32 desired_access, - const struct nt_user_token *token, - struct registry_key **pkey); -WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent, - const char *name, uint32 desired_access, - struct registry_key **pkey); -WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **name, NTTIME *last_write_time); -WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, - uint32 idx, char **pname, struct registry_value **pval); -WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, - const char *name, struct registry_value **pval); -WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, - uint32_t *max_subkeylen, uint32_t *max_subkeysize, - uint32_t *num_values, uint32_t *max_valnamelen, - uint32_t *max_valbufsize, uint32_t *secdescsize, - NTTIME *last_changed_time); -WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, - const char *subkeypath, uint32 desired_access, - struct registry_key **pkey, - enum winreg_CreateAction *paction); -WERROR reg_deletekey(struct registry_key *parent, const char *path); -WERROR reg_setvalue(struct registry_key *key, const char *name, - const struct registry_value *val); -WERROR reg_deletevalue(struct registry_key *key, const char *name); -WERROR reg_getkeysecurity(TALLOC_CTX *mem_ctx, struct registry_key *key, - struct security_descriptor **psecdesc); -WERROR reg_setkeysecurity(struct registry_key *key, - struct security_descriptor *psecdesc); -WERROR reg_getversion(uint32_t *version); -WERROR reg_restorekey(struct registry_key *key, const char *fname); -WERROR reg_savekey(struct registry_key *key, const char *fname); -WERROR reg_deleteallvalues(struct registry_key *key); -WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, - uint32 desired_access, const struct nt_user_token *token, - struct registry_key **pkey); -WERROR reg_deletekey_recursive(TALLOC_CTX *ctx, - struct registry_key *parent, - const char *path); -WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx, - struct registry_key *parent, - const char *path); -WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path, - uint32 desired_access, - const struct nt_user_token *token, - enum winreg_CreateAction *paction, - struct registry_key **pkey); -WERROR reg_delete_path(const struct nt_user_token *token, - const char *orig_path); - -/* The following definitions come from registry/reg_backend_current_version.c */ - - -/* The following definitions come from registry/reg_backend_db.c */ - -WERROR init_registry_key(const char *add_path); -WERROR init_registry_data(void); -WERROR regdb_init(void); -WERROR regdb_open( void ); -int regdb_close( void ); -WERROR regdb_transaction_start(void); -WERROR regdb_transaction_commit(void); -WERROR regdb_transaction_cancel(void); -int regdb_get_seqnum(void); -bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr); -int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr); -int regdb_fetch_values(const char* key, struct regval_ctr *values); -bool regdb_store_values(const char *key, struct regval_ctr *values); -bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys); -bool regdb_values_need_update(struct regval_ctr *values); - -/* The following definitions come from registry/reg_backend_hkpt_params.c */ - - -/* The following definitions come from registry/reg_backend_netlogon_params.c */ - - -/* The following definitions come from registry/reg_backend_perflib.c */ - - -/* The following definitions come from registry/reg_backend_printing.c */ - - -/* The following definitions come from registry/reg_backend_prod_options.c */ - - -/* The following definitions come from registry/reg_backend_shares.c */ - - -/* The following definitions come from registry/reg_backend_smbconf.c */ - - -/* The following definitions come from registry/reg_backend_tcpip_params.c */ - - -/* The following definitions come from registry/reg_cachehook.c */ - -WERROR reghook_cache_init(void); -WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops); -struct registry_ops *reghook_cache_find(const char *keyname); -void reghook_dump_cache( int debuglevel ); - -/* The following definitions come from registry/reg_dispatcher.c */ - -bool store_reg_keys(struct registry_key_handle *key, - struct regsubkey_ctr *subkeys); -bool store_reg_values(struct registry_key_handle *key, struct regval_ctr *val); -WERROR create_reg_subkey(struct registry_key_handle *key, const char *subkey); -WERROR delete_reg_subkey(struct registry_key_handle *key, const char *subkey); -int fetch_reg_keys(struct registry_key_handle *key, - struct regsubkey_ctr *subkey_ctr); -int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val); -bool regkey_access_check(struct registry_key_handle *key, uint32 requested, - uint32 *granted, - const struct nt_user_token *token); -WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, struct registry_key_handle *key, - struct security_descriptor **psecdesc); -WERROR regkey_set_secdesc(struct registry_key_handle *key, - struct security_descriptor *psecdesc); -bool reg_subkeys_need_update(struct registry_key_handle *key, - struct regsubkey_ctr *subkeys); -bool reg_values_need_update(struct registry_key_handle *key, - struct regval_ctr *values); - -/* The following definitions come from registry/reg_eventlog.c */ - -bool eventlog_init_keys(void); -bool eventlog_add_source( const char *eventlog, const char *sourcename, - const char *messagefile ); - -/* The following definitions come from registry/reg_init_basic.c */ - -WERROR registry_init_common(void); -WERROR registry_init_basic(void); - -/* The following definitions come from registry/reg_init_full.c */ - -WERROR registry_init_full(void); - -/* The following definitions come from registry/reg_init_smbconf.c */ - -NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx, - NT_USER_TOKEN **ptoken); -WERROR registry_init_smbconf(const char *keyname); - -/* The following definitions come from registry/reg_objects.c */ - -WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr); -WERROR regsubkey_ctr_reinit(struct regsubkey_ctr *ctr); -WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum); -int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr); -WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname ); -WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname ); -bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname ); -int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr ); -char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index ); -int regval_ctr_numvals(struct regval_ctr *ctr); -struct regval_blob* dup_registry_value(struct regval_blob *val); -void free_registry_value(struct regval_blob *val); -uint8* regval_data_p(struct regval_blob *val); -uint32 regval_size(struct regval_blob *val); -char* regval_name(struct regval_blob *val); -uint32 regval_type(struct regval_blob *val); -struct regval_blob* regval_ctr_specific_value(struct regval_ctr *ctr, - uint32 idx); -bool regval_ctr_key_exists(struct regval_ctr *ctr, const char *value); -struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name, - uint16 type, - const char *data_p, size_t size); -int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16 type, - const char *data_p, size_t size); -int regval_ctr_addvalue_sz(struct regval_ctr *ctr, const char *name, const char *data); -int regval_ctr_addvalue_multi_sz(struct regval_ctr *ctr, const char *name, const char **data); -int regval_ctr_copyvalue(struct regval_ctr *ctr, struct regval_blob *val); -int regval_ctr_delvalue(struct regval_ctr *ctr, const char *name); -struct regval_blob* regval_ctr_getvalue(struct regval_ctr *ctr, - const char *name); -uint32 regval_dword(struct regval_blob *val); -const char *regval_sz(struct regval_blob *val); - -/* The following definitions come from registry/reg_perfcount.c */ - -void perfcount_init_keys( void ); -uint32 reg_perfcount_get_base_index(void); -uint32 reg_perfcount_get_last_counter(uint32 base_index); -uint32 reg_perfcount_get_last_help(uint32 last_counter); -uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf); -uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf); -WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids); - -/* The following definitions come from registry/reg_util.c */ - -bool reg_split_path(char *path, char **base, char **new_path); -bool reg_split_key(char *path, char **base, char **key); -char *normalize_reg_path(TALLOC_CTX *ctx, const char *keyname ); -void normalize_dbkey(char *key); -char *reg_remaining_path(TALLOC_CTX *ctx, const char *key); - -/* The following definitions come from registry/reg_util_legacy.c */ - -WERROR regkey_open_internal(TALLOC_CTX *ctx, - struct registry_key_handle **regkey, - const char *path, - const struct nt_user_token *token, - uint32 access_desired ); - -/* The following definitions come from registry/regfio.c */ - /* The following definitions come from rpc_client/cli_lsarpc.c */ diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h index 8d220ebdf5..761bb49596 100644 --- a/source3/include/reg_objects.h +++ b/source3/include/reg_objects.h @@ -167,4 +167,40 @@ struct registry_key { struct nt_user_token *token; }; +/* The following definitions come from registry/reg_objects.c */ + +WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr); +WERROR regsubkey_ctr_reinit(struct regsubkey_ctr *ctr); +WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum); +int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr); +WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname ); +WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname ); +bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname ); +int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr ); +char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index ); +int regval_ctr_numvals(struct regval_ctr *ctr); +struct regval_blob* dup_registry_value(struct regval_blob *val); +void free_registry_value(struct regval_blob *val); +uint8* regval_data_p(struct regval_blob *val); +uint32 regval_size(struct regval_blob *val); +char* regval_name(struct regval_blob *val); +uint32 regval_type(struct regval_blob *val); +struct regval_blob* regval_ctr_specific_value(struct regval_ctr *ctr, + uint32 idx); +bool regval_ctr_key_exists(struct regval_ctr *ctr, const char *value); +struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name, + uint16 type, + const char *data_p, size_t size); +int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint16 type, + const char *data_p, size_t size); +int regval_ctr_addvalue_sz(struct regval_ctr *ctr, const char *name, const char *data); +int regval_ctr_addvalue_multi_sz(struct regval_ctr *ctr, const char *name, const char **data); +int regval_ctr_copyvalue(struct regval_ctr *ctr, struct regval_blob *val); +int regval_ctr_delvalue(struct regval_ctr *ctr, const char *name); +struct regval_blob* regval_ctr_getvalue(struct regval_ctr *ctr, + const char *name); +uint32 regval_dword(struct regval_blob *val); +const char *regval_sz(struct regval_blob *val); + + #endif /* _REG_OBJECTS_H */ diff --git a/source3/include/regfio.h b/source3/include/regfio.h index 58bfe80c91..61d74d7f2a 100644 --- a/source3/include/regfio.h +++ b/source3/include/regfio.h @@ -27,6 +27,8 @@ #ifndef _REGFIO_H #define _REGFIO_H +struct regsubkey_ctr; + /* Macros */ #define REGF_BLOCKSIZE 0x1000 diff --git a/source3/include/registry.h b/source3/include/registry.h new file mode 100644 index 0000000000..564481945b --- /dev/null +++ b/source3/include/registry.h @@ -0,0 +1,188 @@ +#include "reg_objects.h" + +/* The following definitions come from registry/reg_api.c */ + +WERROR reg_openhive(TALLOC_CTX *mem_ctx, const char *hive, + uint32 desired_access, + const struct nt_user_token *token, + struct registry_key **pkey); +WERROR reg_openkey(TALLOC_CTX *mem_ctx, struct registry_key *parent, + const char *name, uint32 desired_access, + struct registry_key **pkey); +WERROR reg_enumkey(TALLOC_CTX *mem_ctx, struct registry_key *key, + uint32 idx, char **name, NTTIME *last_write_time); +WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, + uint32 idx, char **pname, struct registry_value **pval); +WERROR reg_queryvalue(TALLOC_CTX *mem_ctx, struct registry_key *key, + const char *name, struct registry_value **pval); +WERROR reg_queryinfokey(struct registry_key *key, uint32_t *num_subkeys, + uint32_t *max_subkeylen, uint32_t *max_subkeysize, + uint32_t *num_values, uint32_t *max_valnamelen, + uint32_t *max_valbufsize, uint32_t *secdescsize, + NTTIME *last_changed_time); +WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, + const char *subkeypath, uint32 desired_access, + struct registry_key **pkey, + enum winreg_CreateAction *paction); +WERROR reg_deletekey(struct registry_key *parent, const char *path); +WERROR reg_setvalue(struct registry_key *key, const char *name, + const struct registry_value *val); +WERROR reg_deletevalue(struct registry_key *key, const char *name); +WERROR reg_getkeysecurity(TALLOC_CTX *mem_ctx, struct registry_key *key, + struct security_descriptor **psecdesc); +WERROR reg_setkeysecurity(struct registry_key *key, + struct security_descriptor *psecdesc); +WERROR reg_getversion(uint32_t *version); +WERROR reg_restorekey(struct registry_key *key, const char *fname); +WERROR reg_savekey(struct registry_key *key, const char *fname); +WERROR reg_deleteallvalues(struct registry_key *key); +WERROR reg_open_path(TALLOC_CTX *mem_ctx, const char *orig_path, + uint32 desired_access, const struct nt_user_token *token, + struct registry_key **pkey); +WERROR reg_deletekey_recursive(TALLOC_CTX *ctx, + struct registry_key *parent, + const char *path); +WERROR reg_deletesubkeys_recursive(TALLOC_CTX *ctx, + struct registry_key *parent, + const char *path); +WERROR reg_create_path(TALLOC_CTX *mem_ctx, const char *orig_path, + uint32 desired_access, + const struct nt_user_token *token, + enum winreg_CreateAction *paction, + struct registry_key **pkey); +WERROR reg_delete_path(const struct nt_user_token *token, + const char *orig_path); + +/* The following definitions come from registry/reg_backend_current_version.c */ + + +/* The following definitions come from registry/reg_backend_db.c */ + +WERROR init_registry_key(const char *add_path); +WERROR init_registry_data(void); +WERROR regdb_init(void); +WERROR regdb_open( void ); +int regdb_close( void ); +WERROR regdb_transaction_start(void); +WERROR regdb_transaction_commit(void); +WERROR regdb_transaction_cancel(void); +int regdb_get_seqnum(void); +bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr); +int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr); +int regdb_fetch_values(const char* key, struct regval_ctr *values); +bool regdb_store_values(const char *key, struct regval_ctr *values); +bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys); +bool regdb_values_need_update(struct regval_ctr *values); + +/* The following definitions come from registry/reg_backend_hkpt_params.c */ + + +/* The following definitions come from registry/reg_backend_netlogon_params.c */ + + +/* The following definitions come from registry/reg_backend_perflib.c */ + + +/* The following definitions come from registry/reg_backend_printing.c */ + + +/* The following definitions come from registry/reg_backend_prod_options.c */ + + +/* The following definitions come from registry/reg_backend_shares.c */ + + +/* The following definitions come from registry/reg_backend_smbconf.c */ + + +/* The following definitions come from registry/reg_backend_tcpip_params.c */ + + +/* The following definitions come from registry/reg_cachehook.c */ + +WERROR reghook_cache_init(void); +WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops); +struct registry_ops *reghook_cache_find(const char *keyname); +void reghook_dump_cache( int debuglevel ); + +/* The following definitions come from registry/reg_dispatcher.c */ + +bool store_reg_keys(struct registry_key_handle *key, + struct regsubkey_ctr *subkeys); +bool store_reg_values(struct registry_key_handle *key, struct regval_ctr *val); +WERROR create_reg_subkey(struct registry_key_handle *key, const char *subkey); +WERROR delete_reg_subkey(struct registry_key_handle *key, const char *subkey); +int fetch_reg_keys(struct registry_key_handle *key, + struct regsubkey_ctr *subkey_ctr); +int fetch_reg_values(struct registry_key_handle *key, struct regval_ctr *val); +bool regkey_access_check(struct registry_key_handle *key, uint32 requested, + uint32 *granted, + const struct nt_user_token *token); +WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, struct registry_key_handle *key, + struct security_descriptor **psecdesc); +WERROR regkey_set_secdesc(struct registry_key_handle *key, + struct security_descriptor *psecdesc); +bool reg_subkeys_need_update(struct registry_key_handle *key, + struct regsubkey_ctr *subkeys); +bool reg_values_need_update(struct registry_key_handle *key, + struct regval_ctr *values); + +/* The following definitions come from registry/reg_eventlog.c */ + +bool eventlog_init_keys(void); +bool eventlog_add_source( const char *eventlog, const char *sourcename, + const char *messagefile ); + +/* The following definitions come from registry/reg_init_basic.c */ + +WERROR registry_init_common(void); +WERROR registry_init_basic(void); + +/* The following definitions come from registry/reg_init_full.c */ + +WERROR registry_init_full(void); + +/* The following definitions come from registry/reg_init_smbconf.c */ + +NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx, + NT_USER_TOKEN **ptoken); +WERROR registry_init_smbconf(const char *keyname); + +/* The following definitions come from registry/reg_perfcount.c */ + +void perfcount_init_keys( void ); +uint32 reg_perfcount_get_base_index(void); +uint32 reg_perfcount_get_last_counter(uint32 base_index); +uint32 reg_perfcount_get_last_help(uint32 last_counter); +uint32 reg_perfcount_get_counter_help(uint32 base_index, char **retbuf); +uint32 reg_perfcount_get_counter_names(uint32 base_index, char **retbuf); +WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbuf_len, const char *object_ids); + +/* The following definitions come from registry/reg_util.c */ + +bool reg_split_path(char *path, char **base, char **new_path); +bool reg_split_key(char *path, char **base, char **key); +char *normalize_reg_path(TALLOC_CTX *ctx, const char *keyname ); +void normalize_dbkey(char *key); +char *reg_remaining_path(TALLOC_CTX *ctx, const char *key); + +/* The following definitions come from registry/reg_util_legacy.c */ + +WERROR regkey_open_internal(TALLOC_CTX *ctx, + struct registry_key_handle **regkey, + const char *path, + const struct nt_user_token *token, + uint32 access_desired ); + +/* The following definitions come from registry/regfio.c */ + +/* The following definitions come from lib/util_reg_api.c */ + +WERROR registry_pull_value(TALLOC_CTX *mem_ctx, + struct registry_value **pvalue, + enum winreg_Type type, uint8 *data, + uint32 size, uint32 length); +WERROR registry_push_value(TALLOC_CTX *mem_ctx, + const struct registry_value *value, + DATA_BLOB *presult); + diff --git a/source3/lib/smbconf/smbconf_reg.c b/source3/lib/smbconf/smbconf_reg.c index aa6c60f14c..96b5f1ee24 100644 --- a/source3/lib/smbconf/smbconf_reg.c +++ b/source3/lib/smbconf/smbconf_reg.c @@ -19,6 +19,7 @@ #include "includes.h" #include "lib/smbconf/smbconf_private.h" +#include "registry.h" #define INCLUDES_VALNAME "includes" diff --git a/source3/lib/util_reg_api.c b/source3/lib/util_reg_api.c index 65a74b845d..5f9eb85323 100644 --- a/source3/lib/util_reg_api.c +++ b/source3/lib/util_reg_api.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c index d5290b23a9..6f49a57bb0 100644 --- a/source3/libads/ldap_printer.c +++ b/source3/libads/ldap_printer.c @@ -19,6 +19,7 @@ #include "includes.h" #include "../librpc/gen_ndr/cli_spoolss.h" +#include "registry.h" #ifdef HAVE_ADS diff --git a/source3/libgpo/gpext/registry.c b/source3/libgpo/gpext/registry.c index d7018556d8..57840a4c06 100644 --- a/source3/libgpo/gpext/registry.c +++ b/source3/libgpo/gpext/registry.c @@ -21,6 +21,7 @@ #include "../libgpo/gpo_ini.h" #include "../libgpo/gpo.h" #include "libgpo/gpo_proto.h" +#include "registry.h" #define GP_EXT_NAME "registry" diff --git a/source3/libgpo/gpext/scripts.c b/source3/libgpo/gpext/scripts.c index 3ec5805309..f03dff4e34 100644 --- a/source3/libgpo/gpext/scripts.c +++ b/source3/libgpo/gpext/scripts.c @@ -21,6 +21,7 @@ #include "../libgpo/gpo_ini.h" #include "../libgpo/gpo.h" #include "libgpo/gpo_proto.h" +#include "registry.h" #define GP_EXT_NAME "scripts" diff --git a/source3/libgpo/gpo_reg.c b/source3/libgpo/gpo_reg.c index f191eb8711..b4a9e29177 100644 --- a/source3/libgpo/gpo_reg.c +++ b/source3/libgpo/gpo_reg.c @@ -20,6 +20,7 @@ #include "includes.h" #include "../libgpo/gpo.h" #include "libgpo/gpo_proto.h" +#include "registry.h" /**************************************************************** diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 76f112f818..8e8695c20e 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -22,6 +22,7 @@ #include "includes.h" #include "librpc/gen_ndr/messaging.h" #include "printing/pcap.h" +#include "registry.h" static TDB_CONTEXT *tdb_forms; /* used for forms files */ static TDB_CONTEXT *tdb_drivers; /* used for driver files */ diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 6589a61470..2e16b443f0 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -63,6 +63,7 @@ */ #include "includes.h" +#include "registry.h" #include "regfio.h" #undef DBGC_CLASS diff --git a/source3/registry/reg_backend_current_version.c b/source3/registry/reg_backend_current_version.c index 386c580965..7327dd9204 100644 --- a/source3/registry/reg_backend_current_version.c +++ b/source3/registry/reg_backend_current_version.c @@ -25,6 +25,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 90a6f64115..89a6e95a39 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -21,6 +21,8 @@ /* Implementation of internal registry database functions. */ #include "includes.h" +#include "registry.h" +#include "reg_db.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_hkpt_params.c b/source3/registry/reg_backend_hkpt_params.c index ca37b59522..479d9366b0 100644 --- a/source3/registry/reg_backend_hkpt_params.c +++ b/source3/registry/reg_backend_hkpt_params.c @@ -25,6 +25,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_netlogon_params.c b/source3/registry/reg_backend_netlogon_params.c index 6fc87efb1d..1d5ac719eb 100644 --- a/source3/registry/reg_backend_netlogon_params.c +++ b/source3/registry/reg_backend_netlogon_params.c @@ -25,6 +25,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_perflib.c b/source3/registry/reg_backend_perflib.c index 54e6cfe922..db8e7a3c5d 100644 --- a/source3/registry/reg_backend_perflib.c +++ b/source3/registry/reg_backend_perflib.c @@ -25,6 +25,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_printing.c b/source3/registry/reg_backend_printing.c index e90c708edf..e4a90c2e4c 100644 --- a/source3/registry/reg_backend_printing.c +++ b/source3/registry/reg_backend_printing.c @@ -20,6 +20,7 @@ /* Implementation of registry virtual views for printing information */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_prod_options.c b/source3/registry/reg_backend_prod_options.c index 786bc99eb1..764d98f6d6 100644 --- a/source3/registry/reg_backend_prod_options.c +++ b/source3/registry/reg_backend_prod_options.c @@ -25,6 +25,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_shares.c b/source3/registry/reg_backend_shares.c index 143e79fc9b..e211e439fd 100644 --- a/source3/registry/reg_backend_shares.c +++ b/source3/registry/reg_backend_shares.c @@ -20,6 +20,7 @@ /* Implementation of registry virtual views for printing information */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_smbconf.c b/source3/registry/reg_backend_smbconf.c index 15993438a9..20868d1696 100644 --- a/source3/registry/reg_backend_smbconf.c +++ b/source3/registry/reg_backend_smbconf.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_backend_tcpip_params.c b/source3/registry/reg_backend_tcpip_params.c index fbad0436b6..02bf59c23c 100644 --- a/source3/registry/reg_backend_tcpip_params.c +++ b/source3/registry/reg_backend_tcpip_params.c @@ -25,6 +25,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_cachehook.c b/source3/registry/reg_cachehook.c index 43eae7d61c..6812ecbd7c 100644 --- a/source3/registry/reg_cachehook.c +++ b/source3/registry/reg_cachehook.c @@ -21,6 +21,7 @@ #include "includes.h" #include "adt_tree.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_dispatcher.c b/source3/registry/reg_dispatcher.c index 0c3ceecb6c..874977d622 100644 --- a/source3/registry/reg_dispatcher.c +++ b/source3/registry/reg_dispatcher.c @@ -24,6 +24,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_eventlog.c b/source3/registry/reg_eventlog.c index 7a277e2032..acab5d0848 100644 --- a/source3/registry/reg_eventlog.c +++ b/source3/registry/reg_eventlog.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_init_basic.c b/source3/registry/reg_init_basic.c index eab4ca7f9d..4958df22a0 100644 --- a/source3/registry/reg_init_basic.c +++ b/source3/registry/reg_init_basic.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_init_full.c b/source3/registry/reg_init_full.c index d05a74ef35..fd4026dc96 100644 --- a/source3/registry/reg_init_full.c +++ b/source3/registry/reg_init_full.c @@ -21,6 +21,7 @@ /* Initialize the registry with all available backends. */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_init_smbconf.c b/source3/registry/reg_init_smbconf.c index 28c4187784..632ac3b534 100644 --- a/source3/registry/reg_init_smbconf.c +++ b/source3/registry/reg_init_smbconf.c @@ -18,6 +18,7 @@ */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c index a07e36157e..5bc7cd705b 100644 --- a/source3/registry/reg_objects.c +++ b/source3/registry/reg_objects.c @@ -20,6 +20,7 @@ /* Implementation of registry frontend view functions. */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c index 57d92ff132..19ff62da30 100644 --- a/source3/registry/reg_perfcount.c +++ b/source3/registry/reg_perfcount.c @@ -21,6 +21,7 @@ #include "includes.h" #include "../librpc/gen_ndr/perfcount.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_util.c b/source3/registry/reg_util.c index fd7652116f..483523f100 100644 --- a/source3/registry/reg_util.c +++ b/source3/registry/reg_util.c @@ -20,6 +20,7 @@ /* Implementation of registry frontend view functions. */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/reg_util_legacy.c b/source3/registry/reg_util_legacy.c index 50bc8b92cc..f8f3764c88 100644 --- a/source3/registry/reg_util_legacy.c +++ b/source3/registry/reg_util_legacy.c @@ -20,6 +20,7 @@ /* Implementation of registry frontend view functions. */ #include "includes.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index fa7dc7dfe9..c6194c4061 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -19,6 +19,7 @@ #include "includes.h" #include "regfio.h" +#include "reg_objects.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY diff --git a/source3/rpc_server/srv_eventlog_nt.c b/source3/rpc_server/srv_eventlog_nt.c index 3b109558f0..58b181c038 100644 --- a/source3/rpc_server/srv_eventlog_nt.c +++ b/source3/rpc_server/srv_eventlog_nt.c @@ -23,6 +23,7 @@ #include "includes.h" #include "../librpc/gen_ndr/srv_eventlog.h" #include "lib/eventlog/eventlog.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV diff --git a/source3/rpc_server/srv_ntsvcs_nt.c b/source3/rpc_server/srv_ntsvcs_nt.c index c9f7b22291..cf02e44a21 100644 --- a/source3/rpc_server/srv_ntsvcs_nt.c +++ b/source3/rpc_server/srv_ntsvcs_nt.c @@ -21,6 +21,7 @@ #include "includes.h" #include "../librpc/gen_ndr/srv_ntsvcs.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 3a71e7cef3..823b051e92 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -30,6 +30,7 @@ #include "../librpc/gen_ndr/srv_spoolss.h" #include "../librpc/gen_ndr/cli_spoolss.h" #include "librpc/gen_ndr/messaging.h" +#include "registry.h" /* macros stolen from s4 spoolss server */ #define SPOOLSS_BUFFER_UNION(fn,ic,info,level) \ diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c index e4ddcd35bf..023d2130bf 100644 --- a/source3/rpc_server/srv_svcctl_nt.c +++ b/source3/rpc_server/srv_svcctl_nt.c @@ -25,6 +25,7 @@ #include "includes.h" #include "../librpc/gen_ndr/srv_svcctl.h" #include "services.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV diff --git a/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c index e64118b744..9f8c75acea 100644 --- a/source3/rpc_server/srv_winreg_nt.c +++ b/source3/rpc_server/srv_winreg_nt.c @@ -22,6 +22,7 @@ #include "includes.h" #include "../librpc/gen_ndr/srv_winreg.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 6b62bdeb52..9ab02b5a97 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -25,6 +25,7 @@ #include "includes.h" #include "rpcclient.h" #include "../librpc/gen_ndr/cli_spoolss.h" +#include "registry.h" #define RPCCLIENT_PRINTERNAME(_printername, _cli, _arg) \ { \ diff --git a/source3/services/services_db.c b/source3/services/services_db.c index 0241097a2c..9b28afecd7 100644 --- a/source3/services/services_db.c +++ b/source3/services/services_db.c @@ -22,6 +22,7 @@ #include "includes.h" #include "services.h" +#include "registry.h" struct rcinit_file_information { char *description; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 2c207507c2..fcfabcd06f 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -24,6 +24,7 @@ #include "includes.h" #include "smbd/globals.h" #include "librpc/gen_ndr/messaging.h" +#include "registry.h" static_decl_rpc; diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c index 73d851db6f..63329dea22 100644 --- a/source3/utils/eventlogadm.c +++ b/source3/utils/eventlogadm.c @@ -24,6 +24,7 @@ #include "includes.h" #include "lib/eventlog/eventlog.h" +#include "registry.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_UTIL_EVENTLOG diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c index ae9cdde2fb..0c3aea0f4a 100644 --- a/source3/utils/net_registry.c +++ b/source3/utils/net_registry.c @@ -20,11 +20,11 @@ */ #include "includes.h" +#include "registry.h" #include "utils/net.h" #include "utils/net_registry_util.h" #include "include/g_lock.h" - /* * * Helper functions diff --git a/source3/utils/net_registry_util.c b/source3/utils/net_registry_util.c index 0b0f617222..5bb289335e 100644 --- a/source3/utils/net_registry_util.c +++ b/source3/utils/net_registry_util.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "registry.h" #include "utils/net_registry_util.h" #include "utils/net.h" diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 9d38fca77e..be926864a7 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -19,6 +19,7 @@ #include "includes.h" #include "utils/net.h" #include "../librpc/gen_ndr/cli_spoolss.h" +#include "registry.h" /* support itanium as well */ static const struct print_architecture_table_node archi_table[]= { diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index 2400af4601..6d87bd4e1b 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -18,10 +18,10 @@ along with this program. If not, see . */ #include "includes.h" +#include "registry.h" #include "utils/net.h" #include "utils/net_registry_util.h" #include "regfio.h" -#include "reg_objects.h" #include "../librpc/gen_ndr/cli_winreg.h" /******************************************************************* diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index 0dc9aca876..499f7bd758 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#include "reg_objects.h" #include "regfio.h" /* GLOBAL VARIABLES */ -- cgit