summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_prs.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-03-15 19:43:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:01 -0500
commit61dfab9f705cb38e552dcec1822974433997543c (patch)
treef2b5b3f412f7a31c0de1057a9592a3fdcc6fb427 /source3/rpc_parse/parse_prs.c
parent3b7dccf076628114d4fb1f67ab7aa05457de367d (diff)
downloadsamba-61dfab9f705cb38e552dcec1822974433997543c.tar.gz
samba-61dfab9f705cb38e552dcec1822974433997543c.tar.bz2
samba-61dfab9f705cb38e552dcec1822974433997543c.zip
r5805: merging spoolss parsing changes from trunk and cleaning up resulting segvs
(This used to be commit 25121547caaaed0d60f4db7458570c14e7d21b2a)
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r--source3/rpc_parse/parse_prs.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 4b78d373ba..566efae7a9 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -647,6 +647,34 @@ BOOL prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32)
}
/*******************************************************************
+ Stream a uint32* (allocate memory if unmarshalling)
+ ********************************************************************/
+
+BOOL prs_uint32_p(const char *name, prs_struct *ps, int depth, uint32 **data32)
+{
+ uint32 data_p;
+
+ /* caputure the pointer value to stream */
+
+ data_p = (uint32) *data32;
+
+ if ( !prs_uint32("ptr", ps, depth, &data_p ))
+ return False;
+
+ /* we're done if there is no data */
+
+ if ( !data_p )
+ return True;
+
+ if (UNMARSHALLING(ps)) {
+ if ( !(*data32 = PRS_ALLOC_MEM(ps, uint32, 1)) )
+ return False;
+ }
+
+ return prs_uint32(name, ps, depth, *data32);
+}
+
+/*******************************************************************
Stream a NTSTATUS
********************************************************************/