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 | be552ca3504ebd98da37e70bac1f10b248cf860b (patch) | |
tree | 7d9ebfa1b2637941e75133b2dc815ff4a192fcfb /source3/rpc_parse/parse_misc.c | |
parent | de0c233a7ae5eab1e0f5a2c07eca3269b0bd9cdc (diff) | |
download | samba-be552ca3504ebd98da37e70bac1f10b248cf860b.tar.gz samba-be552ca3504ebd98da37e70bac1f10b248cf860b.tar.bz2 samba-be552ca3504ebd98da37e70bac1f10b248cf860b.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
(This used to be commit 4c515804b70254248e378a3f90f47e4c32639d29)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index a84469f8f9..4927886fc8 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/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) |