summaryrefslogtreecommitdiff
path: root/source4/rpc_server/winreg
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-12-13 02:04:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:21 -0500
commit1971d529b44c8ab7301d824a2add04abc57b72c3 (patch)
tree299d6525d343db304bdfed56c2d3ad359ee83bfa /source4/rpc_server/winreg
parent4c202a20fa7008264ad676ffb2238424bd27baf8 (diff)
downloadsamba-1971d529b44c8ab7301d824a2add04abc57b72c3.tar.gz
samba-1971d529b44c8ab7301d824a2add04abc57b72c3.tar.bz2
samba-1971d529b44c8ab7301d824a2add04abc57b72c3.zip
r4168: Implement QueryValue in the server
IDL for NotifyChangeKeyValue (This used to be commit a40214243136ed5208a1bec494ad1fbf821524ba)
Diffstat (limited to 'source4/rpc_server/winreg')
-rw-r--r--source4/rpc_server/winreg/rpc_winreg.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c
index 41147c089d..e8d4056b2a 100644
--- a/source4/rpc_server/winreg/rpc_winreg.c
+++ b/source4/rpc_server/winreg/rpc_winreg.c
@@ -240,6 +240,11 @@ static WERROR winreg_FlushKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
static WERROR winreg_GetKeySecurity(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct winreg_GetKeySecurity *r)
{
+ struct dcesrv_handle *h;
+
+ h = dcesrv_handle_fetch(dce_call->conn, r->in.handle, HTYPE_REGKEY);
+ DCESRV_CHECK_HANDLE(h);
+
return WERR_NOT_SUPPORTED;
}
@@ -341,7 +346,28 @@ static WERROR winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, TALLOC_CTX
static WERROR winreg_QueryValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct winreg_QueryValue *r)
{
- return WERR_NOT_SUPPORTED;
+ struct dcesrv_handle *h;
+ struct registry_key *key;
+ struct registry_value *val;
+ WERROR result;
+
+ h = dcesrv_handle_fetch(dce_call->conn, r->in.handle, HTYPE_REGKEY);
+ DCESRV_CHECK_HANDLE(h);
+
+ key = h->data;
+
+ result = reg_key_get_value_by_name(mem_ctx, key, r->in.value_name.name, &val);
+
+ if (!W_ERROR_IS_OK(result)) {
+ return result;
+ }
+
+ r->out.type = &val->data_type;
+ r->out.size = r->in.size;
+ r->out.length = &val->data_len;
+ r->out.data = val->data_blk;
+
+ return WERR_OK;
}