summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-06-29 16:13:15 +0200
committerGünther Deschner <gd@samba.org>2010-07-02 10:50:21 +0200
commitb381fba0892021f164223bae8b0951014a28735e (patch)
tree5dc8f39ea4997a0863e9506dbe9387ca7ceb6971 /source3/registry
parent84c5dd1e4bb1b4c45d7b5ac68ab432cfc399835c (diff)
downloadsamba-b381fba0892021f164223bae8b0951014a28735e.tar.gz
samba-b381fba0892021f164223bae8b0951014a28735e.tar.bz2
samba-b381fba0892021f164223bae8b0951014a28735e.zip
s3-registry: avoid using registry_value union.
Just pull and push data as is. Guenther
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_api.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index 65118b9f4c..a3fcff859a 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -357,15 +357,15 @@ WERROR reg_enumvalue(TALLOC_CTX *mem_ctx, struct registry_key *key,
}
blob = regval_ctr_specific_value(key->values, idx);
- err = registry_pull_value(mem_ctx, &val,
- regval_type(blob),
- regval_data_p(blob),
- regval_size(blob),
- regval_size(blob));
- if (!W_ERROR_IS_OK(err)) {
- return err;
+
+ val = talloc_zero(mem_ctx, struct registry_value);
+ if (val == NULL) {
+ return WERR_NOMEM;
}
+ val->type = regval_type(blob);
+ val->data = data_blob_talloc(mem_ctx, regval_data_p(blob), regval_size(blob));
+
if (pname
&& !(*pname = talloc_strdup(
mem_ctx, regval_name(blob)))) {
@@ -661,7 +661,6 @@ WERROR reg_setvalue(struct registry_key *key, const char *name,
const struct registry_value *val)
{
WERROR err;
- DATA_BLOB value_data;
int res;
if (!(key->key->access_granted & KEY_SET_VALUE)) {
@@ -672,14 +671,8 @@ WERROR reg_setvalue(struct registry_key *key, const char *name,
return err;
}
- err = registry_push_value(key, val, &value_data);
- if (!W_ERROR_IS_OK(err)) {
- return err;
- }
-
res = regval_ctr_addvalue(key->values, name, val->type,
- value_data.data, value_data.length);
- TALLOC_FREE(value_data.data);
+ val->data.data, val->data.length);
if (res == 0) {
TALLOC_FREE(key->values);