summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-09-20 11:17:38 +0200
committerMichael Adam <obnox@samba.org>2010-09-21 06:53:32 +0200
commitd760e543a1340a2166a43f83b27b5a4a6a39dfcf (patch)
tree6de0deeb4edf512fabe274e81468918c91b2c5a7 /source3
parent4cee4bbd02cdd0e4bc458378016621948e58d47c (diff)
downloadsamba-d760e543a1340a2166a43f83b27b5a4a6a39dfcf.tar.gz
samba-d760e543a1340a2166a43f83b27b5a4a6a39dfcf.tar.bz2
samba-d760e543a1340a2166a43f83b27b5a4a6a39dfcf.zip
s3:rpc_server:ntsvcs: use svcctl_lookup_dispname instead of legacy svcctl in _PNP_GetDeviceRegProp
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_ntsvcs_nt.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source3/rpc_server/srv_ntsvcs_nt.c b/source3/rpc_server/srv_ntsvcs_nt.c
index aed9a5319c..0cc4d31c94 100644
--- a/source3/rpc_server/srv_ntsvcs_nt.c
+++ b/source3/rpc_server/srv_ntsvcs_nt.c
@@ -125,8 +125,9 @@ WERROR _PNP_GetDeviceRegProp(struct pipes_struct *p,
struct PNP_GetDeviceRegProp *r)
{
char *ptr;
- struct regval_ctr *values;
- struct regval_blob *val;
+ const char *result;
+ DATA_BLOB blob;
+ TALLOC_CTX *mem_ctx = NULL;
switch( r->in.property ) {
case DEV_REGPROP_DESC:
@@ -141,31 +142,34 @@ WERROR _PNP_GetDeviceRegProp(struct pipes_struct *p,
return WERR_GENERAL_FAILURE;
ptr++;
- if ( !(values = svcctl_fetch_regvalues(
- ptr, p->server_info->ptok)))
+ mem_ctx = talloc_stackframe();
+
+ result = svcctl_lookup_dispname(mem_ctx, ptr, p->server_info->ptok);
+ if (result == NULL) {
return WERR_GENERAL_FAILURE;
+ }
- if ( !(val = regval_ctr_getvalue( values, "DisplayName" )) ) {
- TALLOC_FREE( values );
+ if (!push_reg_sz(mem_ctx, &blob, result)) {
+ talloc_free(mem_ctx);
return WERR_GENERAL_FAILURE;
}
- if (*r->in.buffer_size < regval_size(val)) {
- *r->out.needed = regval_size(val);
+ if (*r->in.buffer_size < blob.length) {
+ *r->out.needed = blob.length;
*r->out.buffer_size = 0;
- TALLOC_FREE( values );
+ talloc_free(mem_ctx);
return WERR_CM_BUFFER_SMALL;
}
- r->out.buffer = (uint8_t *)talloc_memdup(p->mem_ctx, regval_data_p(val), regval_size(val));
- TALLOC_FREE(values);
+ r->out.buffer = (uint8_t *)talloc_memdup(p->mem_ctx, blob.data, blob.length);
+ talloc_free(mem_ctx);
if (!r->out.buffer) {
return WERR_NOMEM;
}
*r->out.reg_data_type = REG_SZ; /* always 1...tested using a remove device manager connection */
- *r->out.buffer_size = regval_size(val);
- *r->out.needed = regval_size(val);
+ *r->out.buffer_size = blob.length;
+ *r->out.needed = blob.length;
break;