summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-25 00:36:43 +0200
committerGünther Deschner <gd@samba.org>2009-09-30 00:30:25 +0200
commit2d6e5e160b9fd1a21bbbe699f6786c570daa0467 (patch)
tree2a825ecb8abb4688b37c13366508a6f396707478 /source3/rpc_server
parent1b0f3b7e3a3eadb1c9997b38dd41aa4c09c41a46 (diff)
downloadsamba-2d6e5e160b9fd1a21bbbe699f6786c570daa0467.tar.gz
samba-2d6e5e160b9fd1a21bbbe699f6786c570daa0467.tar.bz2
samba-2d6e5e160b9fd1a21bbbe699f6786c570daa0467.zip
s3: use push_reg_multi_sz().
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_ntsvcs_nt.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/rpc_server/srv_ntsvcs_nt.c b/source3/rpc_server/srv_ntsvcs_nt.c
index 553707bfe5..357478f274 100644
--- a/source3/rpc_server/srv_ntsvcs_nt.c
+++ b/source3/rpc_server/srv_ntsvcs_nt.c
@@ -76,9 +76,8 @@ WERROR _PNP_GetDeviceList(pipes_struct *p,
{
char *devicepath;
uint32_t size = 0;
- char **multi_sz = NULL;
- size_t multi_sz_len;
- uint16_t *multi_sz_buf;
+ const char **multi_sz = NULL;
+ DATA_BLOB blob;
if ((r->in.flags & CM_GETIDLIST_FILTER_SERVICE) &&
(!r->in.filter)) {
@@ -95,23 +94,22 @@ WERROR _PNP_GetDeviceList(pipes_struct *p,
return WERR_CM_BUFFER_SMALL;
}
- multi_sz = talloc_zero_array(p->mem_ctx, char *, 2);
+ multi_sz = talloc_zero_array(p->mem_ctx, const char *, 2);
if (!multi_sz) {
return WERR_NOMEM;
}
multi_sz[0] = devicepath;
- multi_sz_len = regval_build_multi_sz(multi_sz, &multi_sz_buf);
- if (!multi_sz_len) {
+ if (!push_reg_multi_sz(multi_sz, &blob, multi_sz)) {
return WERR_NOMEM;
}
- if (*r->in.length < multi_sz_len/2) {
+ if (*r->in.length < blob.length/2) {
return WERR_CM_BUFFER_SMALL;
}
- memcpy(r->out.buffer, multi_sz_buf, multi_sz_len);
+ memcpy(r->out.buffer, blob.data, blob.length);
return WERR_OK;
}