summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-09 12:42:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:28 -0500
commit2f1193715ff5815498f16cba4391d7ba5f212366 (patch)
treebd9be4ce0ec1a5f32b2512dcdfd1d1c52a95f71d /source4
parentb7f53e9d1807f854b6bd1b357bc4a20ab48a4a89 (diff)
downloadsamba-2f1193715ff5815498f16cba4391d7ba5f212366.tar.gz
samba-2f1193715ff5815498f16cba4391d7ba5f212366.tar.bz2
samba-2f1193715ff5815498f16cba4391d7ba5f212366.zip
r4116: fixed compilation of EnumValue code in winreg rpc backend
thanks to volker for pointing this out (This used to be commit 2b67f18bdb58164697efd428391d4cbc46398464)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
index fae5d3f14e..3969a763e0 100644
--- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
+++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
@@ -226,9 +226,10 @@ static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *p
struct rpc_key_data *mykeydata = parent->backend_data;
WERROR error;
struct winreg_EnumValue r;
- uint32 type, len1, len2 = 0;
- struct EnumValueIn buf_name, buf_val;
+ uint32 type, len1, zero = 0;
NTSTATUS status;
+ uint8_t buf8;
+ uint16_t buf16;
if(mykeydata->num_values == -1) {
error = rpc_query_key(parent);
@@ -239,19 +240,13 @@ static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *p
r.in.handle = &mykeydata->pol;
r.in.enum_index = n;
- r.in.name_in.len = 0;
- r.in.name_in.max_len = mykeydata->max_valnamelen * 2;
- buf_name.max_len = mykeydata->max_valnamelen;
- buf_name.offset = 0;
- buf_name.len = 0;
- r.in.name_in.buffer = &buf_name;
+ r.in.name_in.length = 0;
+ r.in.name_in.size = mykeydata->max_valnamelen * 2;
+ r.in.name_in.name = &buf16;
r.in.type = &type;
- buf_val.max_len = mykeydata->max_valdatalen;
- buf_val.offset = 0;
- buf_val.len = 0;
- r.in.value_in = &buf_val;
- r.in.value_len1 = &len1;
- r.in.value_len2 = &len2;
+ r.in.value = &buf8;
+ r.in.length = &zero;
+ r.in.size = &len1;
r.out.type = &type;
@@ -261,13 +256,14 @@ static WERROR rpc_get_value_by_index(TALLOC_CTX *mem_ctx, struct registry_key *p
return WERR_GENERAL_FAILURE;
}
- if(NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(r.out.result)) {
+ if(NT_STATUS_IS_OK(status) &&
+ W_ERROR_IS_OK(r.out.result) && r.out.length) {
*value = talloc_p(mem_ctx, struct registry_value);
(*value)->parent = parent;
(*value)->name = talloc_strdup(mem_ctx, r.out.name_out.name);
(*value)->data_type = type;
- (*value)->data_len = r.out.value_out->buffer.length;
- (*value)->data_blk = talloc_memdup(mem_ctx, r.out.value_out->buffer.data, r.out.value_out->buffer.length);
+ (*value)->data_len = *r.out.length;
+ (*value)->data_blk = talloc_memdup(mem_ctx, r.out.value, *r.out.length);
return WERR_OK;
}