From 1ab463a79575316612097445ea40b9dd7bcb84bd Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 12 Nov 1998 16:03:35 +0000 Subject: security descriptors and registry. (This used to be commit 9814ac8a65f4d8333527976f1d227e8cd3c2c8ce) --- source3/rpc_parse/parse_misc.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'source3/rpc_parse/parse_misc.c') 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 @@ -296,6 +296,43 @@ void make_buf_hdr(BUFHDR *hdr, int max_len, int len) hdr->buf_len = 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. ********************************************************************/ -- cgit