summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_prs.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-11-11 19:22:08 +0000
committerLuke Leighton <lkcl@samba.org>1998-11-11 19:22:08 +0000
commit60a91a1dca12e675e4498062f33ed773ddd5600a (patch)
tree7b828ffbd2c92b29f88238d1f43cce0b5b493953 /source3/rpc_parse/parse_prs.c
parent16a243ec5efe0fed8a6934442e87f57c635e4703 (diff)
downloadsamba-60a91a1dca12e675e4498062f33ed773ddd5600a.tar.gz
samba-60a91a1dca12e675e4498062f33ed773ddd5600a.tar.bz2
samba-60a91a1dca12e675e4498062f33ed773ddd5600a.zip
clearing up security descriptor
(This used to be commit abdc9d790b7d27b70aaf88451f5c82c99c94ca6e)
Diffstat (limited to 'source3/rpc_parse/parse_prs.c')
-rw-r--r--source3/rpc_parse/parse_prs.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 873a689792..cc068778ac 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -303,14 +303,18 @@ BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, ui
prs_uint16 wrapper. call this and it sets up a pointer to where the
uint16 should be stored, or gets the size if reading
********************************************************************/
-BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *off_ptr)
+BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset)
{
- (*off_ptr) = ps->offset;
+ (*offset) = ps->io;
if (ps->io)
{
/* reading. */
return prs_uint16(name, ps, depth, data16);
}
+ else
+ {
+ ps->offset += sizeof(uint16);
+ }
return True;
}
@@ -318,7 +322,7 @@ BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint3
prs_uint16 wrapper. call this and it retrospectively stores the size.
does nothing on reading, as that is already handled by ...._pre()
********************************************************************/
-BOOL prs_uint16_post(char *name, prs_struct *ps, int depth,
+BOOL prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16,
uint32 ptr_uint16, uint32 start_offset)
{
if (!ps->io)
@@ -331,6 +335,53 @@ BOOL prs_uint16_post(char *name, prs_struct *ps, int depth,
prs_uint16(name, ps, depth, &data_size);
ps->offset = old_offset;
}
+ else
+ {
+ ps->offset = start_offset + (*data16);
+ }
+ return True;
+}
+
+/*******************************************************************
+ prs_uint32 wrapper. call this and it sets up a pointer to where the
+ uint32 should be stored, or gets the size if reading
+ ********************************************************************/
+BOOL prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset)
+{
+ (*offset) = ps->io;
+ if (ps->io)
+ {
+ /* reading. */
+ return prs_uint32(name, ps, depth, data32);
+ }
+ else
+ {
+ ps->offset += sizeof(uint32);
+ }
+ return True;
+}
+
+/*******************************************************************
+ prs_uint32 wrapper. call this and it retrospectively stores the size.
+ does nothing on reading, as that is already handled by ...._pre()
+ ********************************************************************/
+BOOL prs_uint32_post(char *name, prs_struct *ps, int depth, uint32 *data32,
+ uint32 ptr_uint32, uint32 start_offset)
+{
+ if (!ps->io)
+ {
+ /* storing: go back and do a retrospective job. i hate this */
+ uint32 data_size = ps->offset - start_offset;
+ uint32 old_offset = ps->offset;
+
+ ps->offset = ptr_uint32;
+ prs_uint32(name, ps, depth, &data_size);
+ ps->offset = old_offset;
+ }
+ else
+ {
+ ps->offset = start_offset + (*data32);
+ }
return True;
}