diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-04-12 21:59:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:16 -0500 |
commit | 17ddb68b54c6c550bc4614d33f7da69fc5f75633 (patch) | |
tree | 197c9d61f5fcd2dc4b578ebf193e542a07922381 /source4/lib/registry/reg_backend_rpc | |
parent | 00cedc0c0448b3520678c7959ea9269d6e5c10f1 (diff) | |
download | samba-17ddb68b54c6c550bc4614d33f7da69fc5f75633.tar.gz samba-17ddb68b54c6c550bc4614d33f7da69fc5f75633.tar.bz2 samba-17ddb68b54c6c550bc4614d33f7da69fc5f75633.zip |
r190: More RPC updates
(This used to be commit 0a67057e9626c1539f964e978537e24544784263)
Diffstat (limited to 'source4/lib/registry/reg_backend_rpc')
-rw-r--r-- | source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c | 53 |
1 files changed, 53 insertions, 0 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 f5a7127ed6..472a851638 100644 --- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c +++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c @@ -75,6 +75,8 @@ struct rpc_key_data { struct policy_handle pol; int num_subkeys; int num_values; + int max_valnamelen; + int max_valdatalen; }; struct { @@ -194,6 +196,54 @@ static WERROR rpc_open_key(REG_HANDLE *h, const char *name, REG_KEY **key) return rpc_key_put_rpc_data(*key, &mykeydata); } +static WERROR rpc_get_value_by_index(REG_KEY *parent, int n, REG_VAL **value) +{ + struct winreg_EnumValue r; + struct winreg_Uint8buf vb; + struct winreg_Uint16buf bn; + struct rpc_data *mydata = parent->handle->backend_data; + struct winreg_EnumValueName vn; + NTSTATUS status; + struct rpc_key_data *mykeydata = parent->backend_data; + uint32 type = 0x0, requested_len = 0, returned_len = 0; + + /* FIXME */ + + r.in.handle = &mykeydata->pol; + r.in.enum_index = n; + r.in.type = r.out.type = &type; + r.in.requested_len = r.out.requested_len = &requested_len; + r.in.returned_len = r.out.returned_len = &returned_len; + bn.max_len = mykeydata->max_valnamelen*3; + bn.offset = 0; + bn.len = 0; + bn.buffer = NULL; + vn.max_len = mykeydata->max_valnamelen*3; + vn.buf = &bn; + r.in.name = r.out.name = &vn; + vb.max_len = mykeydata->max_valdatalen*3; + vb.offset = 0x0; + vb.len = 0x0; + vb.buffer = NULL; + r.in.value = r.out.value = &vb; + + status = dcerpc_winreg_EnumValue(mydata->pipe, parent->mem_ctx, &r); + if(NT_STATUS_IS_ERR(status)) { + DEBUG(0, ("Error in EnumValue: %s\n", nt_errstr(status))); + } + + if(NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(r.out.result)) { + *value = reg_val_new(parent, NULL); + (*value)->name = (char *)r.out.name->buf->buffer; + (*value)->data_type = type; + (*value)->data_len = r.out.value->len; + (*value)->data_blk = r.out.value->buffer; + return WERR_OK; + } + + return r.out.result; +} + static WERROR rpc_get_subkey_by_index(REG_KEY *parent, int n, REG_KEY **subkey) { struct winreg_EnumKey r; @@ -269,6 +319,8 @@ static WERROR rpc_query_key(REG_KEY *k) if (W_ERROR_IS_OK(r.out.result)) { mykeydata->num_subkeys = r.out.num_subkeys; mykeydata->num_values = r.out.num_values; + mykeydata->max_valnamelen = r.out.max_valnamelen; + mykeydata->max_valdatalen = r.out.max_valbufsize; } return r.out.result; @@ -355,6 +407,7 @@ static struct registry_ops reg_backend_rpc = { .open_root_key = rpc_open_root, .open_key = rpc_open_key, .get_subkey_by_index = rpc_get_subkey_by_index, + .get_value_by_index = rpc_get_value_by_index, .add_key = rpc_add_key, .del_key = rpc_del_key, .free_key_backend_data = rpc_close_key, |