summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_reg.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-18 17:57:21 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-18 17:57:21 +0000
commita394a4a8fa2c4c0ff03fbc5bc4ea925245ec1fed (patch)
tree37225bf66089879429df84fdc144bebe46bfebe4 /source3/rpc_parse/parse_reg.c
parentccc8585567804d6a7e6f684a97d58871e2fd9f8a (diff)
downloadsamba-a394a4a8fa2c4c0ff03fbc5bc4ea925245ec1fed.tar.gz
samba-a394a4a8fa2c4c0ff03fbc5bc4ea925245ec1fed.tar.bz2
samba-a394a4a8fa2c4c0ff03fbc5bc4ea925245ec1fed.zip
updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*. now copes with multiple types. (This used to be commit 3df7c903c5b70f336294a95ad864aedbacf544b0)
Diffstat (limited to 'source3/rpc_parse/parse_reg.c')
-rw-r--r--source3/rpc_parse/parse_reg.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c
index 1a0168f21d..ec2699e745 100644
--- a/source3/rpc_parse/parse_reg.c
+++ b/source3/rpc_parse/parse_reg.c
@@ -896,27 +896,31 @@ BOOL reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth)
creates a structure.
********************************************************************/
BOOL make_reg_r_info(REG_R_INFO *r_r,
- uint32 type, char *buf,
+ uint32 *type, BUFFER2 *buf,
uint32 status)
{
- int len;
-
- if (r_r == NULL || buf == NULL) return False;
-
- len = strlen(buf);
+ if (r_r == NULL) return False;
- r_r->ptr_type = type;
+ r_r->ptr_type = type != NULL ? 1 : 0;
r_r->type = type;
- r_r->ptr_uni_type = 1;
- make_buffer2(&(r_r->uni_type), buf, len);
-
- r_r->ptr_max_len = 1;
- r_r->buf_max_len = r_r->uni_type.buf_max_len;
+ r_r->ptr_uni_type = buf != NULL ? 1 : 0;
+ r_r->uni_type = buf;
- r_r->ptr_len = 1;
- r_r->buf_len = r_r->uni_type.buf_len;
+ if (buf != NULL)
+ {
+ r_r->ptr_max_len = 1;
+ r_r->buf_max_len = r_r->uni_type->buf_max_len;
+ r_r->ptr_len = 1;
+ r_r->buf_len = r_r->uni_type->buf_len;
+ }
+ else
+ {
+ r_r->ptr_max_len = 0;
+ r_r->ptr_len = 0;
+ }
+
r_r->status = status;
return True;
@@ -937,11 +941,11 @@ BOOL reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth)
prs_uint32("ptr_type", ps, depth, &(r_r->ptr_type));
if (r_r->ptr_type != 0)
{
- prs_uint32("type", ps, depth, &(r_r->type));
+ prs_uint32("type", ps, depth, r_r->type);
}
prs_uint32("ptr_uni_type", ps, depth, &(r_r->ptr_uni_type));
- smb_io_buffer2("uni_type", &(r_r->uni_type), r_r->ptr_uni_type, ps, depth);
+ smb_io_buffer2("uni_type", r_r->uni_type, r_r->ptr_uni_type, ps, depth);
prs_align(ps);
prs_uint32("ptr_max_len", ps, depth, &(r_r->ptr_max_len));