diff options
author | Jean-François Micouleau <jfm@samba.org> | 1999-04-27 10:43:32 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 1999-04-27 10:43:32 +0000 |
commit | 4c515804b70254248e378a3f90f47e4c32639d29 (patch) | |
tree | 108069162095c0f27316fba48caae142683fe575 /source/rpc_parse/parse_misc.c | |
parent | 9e8192cc674db7551569d23982877dd25c488b50 (diff) | |
download | samba-4c515804b70254248e378a3f90f47e4c32639d29.tar.gz samba-4c515804b70254248e378a3f90f47e4c32639d29.tar.xz samba-4c515804b70254248e378a3f90f47e4c32639d29.zip |
rpc_parse/parse_misc.c : defined a new BUFFER5 struct
include/ntdomain.h : added rpc_spoolss.h include statement
include/proto.h
include/rpc_dce.h : added definition of RPC_ALTER_CONTEXT request &
reply
param/loadparm.c : 2 new options for NT printing support and some
changes to initial values in the LPRNG case.
rpc_parse/parse_prs.c : added prs_uint16s()
rpc_parse/parse_rpc.c : added SYNT_SPOOLSS_V1 and code for the
alter-context support.
rpc_server/srv_pipe.c : alter-context support
smbd/nttrans.c
smbd/server.c
include/rpc_misc.h
Makefile.in
include/smb.h
Jean Francois
Diffstat (limited to 'source/rpc_parse/parse_misc.c')
-rw-r--r-- | source/rpc_parse/parse_misc.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c index a84469f8f9c..4927886fc80 100644 --- a/source/rpc_parse/parse_misc.c +++ b/source/rpc_parse/parse_misc.c @@ -519,6 +519,71 @@ void smb_io_buffer4(char *desc, BUFFER4 *buf4, uint32 buffer, prs_struct *ps, in } /******************************************************************* +initialise a BUFFER5 structure. +********************************************************************/ +void init_buffer5(BUFFER5 **str) +{ + BUFFER5 *buf5; + + buf5=(BUFFER5 *)malloc( sizeof(BUFFER5) ); + + buf5->buf_len=0; + buf5->buffer=NULL; + *str=buf5; +} + +/******************************************************************* +clear a BUFFER5 structure. +********************************************************************/ +void clear_buffer5(BUFFER5 **str) +{ + BUFFER5 *buf5; + + buf5=*str; + if (buf5->buffer != NULL ) + { + free(buf5->buffer); + } + free(buf5); + *str=NULL; +} + +/******************************************************************* +creates a BUFFER5 structure. +********************************************************************/ +void make_buffer5(BUFFER5 *str, char *buf, int len) +{ + + /* max buffer size (allocated size) */ + str->buf_len = len; + str->buffer = (uint16 *)malloc( sizeof(uint16) * len ); + ascii_to_unistr(str->buffer, buf, len); +} + +/******************************************************************* +reads or writes a BUFFER5 structure. +the buf_len member tells you how large the buffer is. +********************************************************************/ +void smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth) +{ + prs_debug(ps, depth, desc, "smb_io_buffer4"); + depth++; + + if (buf5 == NULL) return; + + prs_align(ps); + prs_uint32("buf_len", ps, depth, &(buf5->buf_len)); + + /* reading: alloc the buffer first */ + if ( ps->io ) + { + buf5->buffer=(uint16 *)malloc( sizeof(uint16)*buf5->buf_len ); + } + + prs_uint16s(True, "buffer ", ps, depth, buf5->buffer, buf5->buf_len); +} + +/******************************************************************* creates a BUFFER2 structure. ********************************************************************/ void make_buffer2(BUFFER2 *str, const char *buf, int len) |