summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-11-12 16:03:35 +0000
committerLuke Leighton <lkcl@samba.org>1998-11-12 16:03:35 +0000
commit1ab463a79575316612097445ea40b9dd7bcb84bd (patch)
tree089522c8e7365ea67d4db5ee28573e3c9391fe6e /source3/rpc_parse/parse_misc.c
parentfe7090cfb052729b75873c13c75578323aff2a5d (diff)
downloadsamba-1ab463a79575316612097445ea40b9dd7bcb84bd.tar.gz
samba-1ab463a79575316612097445ea40b9dd7bcb84bd.tar.bz2
samba-1ab463a79575316612097445ea40b9dd7bcb84bd.zip
security descriptors and registry.
(This used to be commit 9814ac8a65f4d8333527976f1d227e8cd3c2c8ce)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index b21057033f..9d5620bbf0 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -297,6 +297,43 @@ void make_buf_hdr(BUFHDR *hdr, int max_len, int len)
}
/*******************************************************************
+ prs_uint16 wrapper. call this and it sets up a pointer to where the
+ uint16 should be stored, or gets the size if reading
+ ********************************************************************/
+void smb_io_hdrbuf_pre(char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset)
+{
+ (*offset) = ps->offset;
+ if (ps->io)
+ {
+ /* reading. */
+ smb_io_hdrbuf(desc, hdr, ps, depth);
+ }
+ else
+ {
+ ps->offset += sizeof(uint32) * 2;
+ }
+}
+
+/*******************************************************************
+ smb_io_hdrbuf wrapper. call this and it retrospectively stores the size.
+ does nothing on reading, as that is already handled by ...._pre()
+ ********************************************************************/
+void smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth,
+ uint32 ptr_hdrbuf, uint32 start_offset)
+{
+ if (!ps->io)
+ {
+ /* storing: go back and do a retrospective job. i hate this */
+ int data_size = ps->offset - start_offset;
+ uint32 old_offset = ps->offset;
+
+ make_buf_hdr(hdr, data_size, data_size);
+ ps->offset = ptr_hdrbuf;
+ smb_io_hdrbuf(desc, hdr, ps, depth);
+ ps->offset = old_offset;
+ }
+}
+/*******************************************************************
reads or writes a BUFHDR structure.
********************************************************************/
void smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth)