diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-12-10 22:28:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:06:30 -0500 |
commit | a9fa37d6187eb0d0a074fec2ecffe2915b701188 (patch) | |
tree | 35f08289b3648b80c16580c1d93c0057705845e8 /source4/lib/registry/common | |
parent | 9f9e9b6477c4037372f871495abe7b81f15fb58c (diff) | |
download | samba-a9fa37d6187eb0d0a074fec2ecffe2915b701188.tar.gz samba-a9fa37d6187eb0d0a074fec2ecffe2915b701188.tar.bz2 samba-a9fa37d6187eb0d0a074fec2ecffe2915b701188.zip |
r4137: Make *_open_key take a registry_key instead of a hive (more efficient
in some cases)
(This used to be commit ddf7a331c58976f2c0b4a00390118f1acf60e3eb)
Diffstat (limited to 'source4/lib/registry/common')
-rw-r--r-- | source4/lib/registry/common/reg_interface.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index a93fa31836..2382e4aa43 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -218,7 +218,6 @@ WERROR reg_open_key_abs(TALLOC_CTX *mem_ctx, struct registry_context *handle, co */ WERROR reg_open_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char *name, struct registry_key **result) { - char *fullname; WERROR error; if(!parent) { @@ -257,15 +256,12 @@ WERROR reg_open_key(TALLOC_CTX *mem_ctx, struct registry_key *parent, const char return WERR_NOT_SUPPORTED; } - - fullname = ((parent->hive->root == parent)?talloc_strdup(mem_ctx, name):talloc_asprintf(mem_ctx, "%s\\%s", parent->path, name)); - - error = parent->hive->functions->open_key(mem_ctx, parent->hive, fullname, result); + error = parent->hive->functions->open_key(mem_ctx, parent, name, result); if(!W_ERROR_IS_OK(error)) return error; (*result)->hive = parent->hive; - (*result)->path = fullname; + (*result)->path = ((parent->hive->root == parent)?talloc_strdup(mem_ctx, name):talloc_asprintf(mem_ctx, "%s\\%s", parent->path, name)); (*result)->hive = parent->hive; return WERR_OK; @@ -369,7 +365,7 @@ WERROR reg_key_get_subkey_by_name(TALLOC_CTX *mem_ctx, struct registry_key *key, if(key->hive->functions->get_subkey_by_name) { error = key->hive->functions->get_subkey_by_name(mem_ctx, key,name,subkey); } else if(key->hive->functions->open_key) { - error = key->hive->functions->open_key(mem_ctx, key->hive, talloc_asprintf(mem_ctx, "%s\\%s", key->path, name), subkey); + error = key->hive->functions->open_key(mem_ctx, key, name, subkey); } else if(key->hive->functions->get_subkey_by_index) { for(i = 0; W_ERROR_IS_OK(error); i++) { error = reg_key_get_subkey_by_index(mem_ctx, key, i, subkey); |