From b4c720412978c0a49e11846c7cfe553d055cca1f Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 5 Apr 2005 17:49:16 +0000 Subject: r6218: * fix a segv in EnumPrinters():rpc_buffer_alloc when the caller does not provide an RPC_BUFFER in the request * add initial (but wire untested) support for RegRestoreKey() (This used to be commit 22855c7aae940cc4082c231a470f612b8fc6fa0d) --- source3/rpc_parse/parse_buffer.c | 5 +++++ source3/rpc_parse/parse_reg.c | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) (limited to 'source3/rpc_parse') diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c index ea72df8db4..a48d5cfa98 100644 --- a/source3/rpc_parse/parse_buffer.c +++ b/source3/rpc_parse/parse_buffer.c @@ -134,6 +134,11 @@ BOOL rpcbuf_alloc_size(RPC_BUFFER *buffer, uint32 buffer_size) uint32 extra_space; uint32 old_offset; + /* if we don't need anything. don't do anything */ + + if ( buffer_size == 0x0 ) + return True; + ps= &buffer->prs; /* damn, I'm doing the reverse operation of prs_grow() :) */ diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index fabffd2b6d..09e19bf701 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -568,6 +568,54 @@ BOOL reg_io_r_getversion(const char *desc, REG_R_GETVERSION *r_u, prs_struct *p } +/******************************************************************* +reads or writes a structure. +********************************************************************/ + +BOOL reg_io_q_restore_key(const char *desc, REG_Q_RESTORE_KEY *q_u, prs_struct *ps, int depth) +{ + if ( !q_u ) + return False; + + prs_debug(ps, depth, desc, "reg_io_q_restore_key"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!smb_io_pol_hnd("", &q_u->pol, ps, depth)) + return False; + + if(!prs_unistr4("filename", ps, depth, &q_u->filename)) + return False; + + if(!prs_uint32("flags", ps, depth, &q_u->flags)) + return False; + + return True; +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ + +BOOL reg_io_r_restore_key(const char *desc, REG_R_RESTORE_KEY *r_u, prs_struct *ps, int depth) +{ + if ( !r_u ) + return False; + + prs_debug(ps, depth, desc, "reg_io_r_restore_key"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!prs_werror("status" , ps, depth, &r_u->status)) + return False; + + return True; +} + /******************************************************************* reads or writes a structure. ********************************************************************/ -- cgit