diff options
author | Jean-François Micouleau <jfm@samba.org> | 2000-03-13 19:34:04 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2000-03-13 19:34:04 +0000 |
commit | c5fbb293a8fe2cc2251ffa0d46c79a2d247f7d9a (patch) | |
tree | 49f3aa751f9f7b3177f75e5e5c585a35b8381247 /source3/rpc_parse | |
parent | 7d2a8cd4c621e6a13476b994f872661390cb6787 (diff) | |
download | samba-c5fbb293a8fe2cc2251ffa0d46c79a2d247f7d9a.tar.gz samba-c5fbb293a8fe2cc2251ffa0d46c79a2d247f7d9a.tar.bz2 samba-c5fbb293a8fe2cc2251ffa0d46c79a2d247f7d9a.zip |
oops ! forgot smb.h in last commit
added info level 1 parsing code for addprinter(ex)
J.F.
(This used to be commit 4847f7b17b2d23e4efd4e7cae6bfcfc2319b9409)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 85d295eb3f..8ff26e090c 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -3046,6 +3046,36 @@ BOOL spoolss_io_q_enumports(char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, } /******************************************************************* + Parse a SPOOL_PRINTER_INFO_LEVEL_1 structure. +********************************************************************/ +BOOL spool_io_printer_info_level_1(char *desc, SPOOL_PRINTER_INFO_LEVEL_1 *il, prs_struct *ps, int depth) +{ + prs_debug(ps, depth, desc, "spool_io_printer_info_level_1"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!prs_uint32("flags", ps, depth, &il->flags)) + return False; + if(!prs_uint32("description_ptr", ps, depth, &il->description_ptr)) + return False; + if(!prs_uint32("name_ptr", ps, depth, &il->name_ptr)) + return False; + if(!prs_uint32("comment_ptr", ps, depth, &il->comment_ptr)) + return False; + + if(!smb_io_unistr2("description", &il->description, il->description_ptr, ps, depth)) + return False; + if(!smb_io_unistr2("name", &il->name, il->name_ptr, ps, depth)) + return False; + if(!smb_io_unistr2("comment", &il->comment, il->comment_ptr, ps, depth)) + return False; + + return True; +} + +/******************************************************************* Parse a SPOOL_PRINTER_INFO_LEVEL_2 structure. ********************************************************************/ BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 *il, prs_struct *ps, int depth) @@ -3142,8 +3172,10 @@ BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_s /* if no struct inside just return */ if (il->info_ptr==0) { - if (UNMARSHALLING(ps)) + if (UNMARSHALLING(ps)) { + il->info_1=NULL; il->info_2=NULL; + } return True; } @@ -3158,6 +3190,12 @@ BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_s * level 2 is used by addprinter * and by setprinter when updating printer's info */ + case 1: + if (UNMARSHALLING(ps)) + il->info_1=(SPOOL_PRINTER_INFO_LEVEL_1 *)malloc(sizeof(SPOOL_PRINTER_INFO_LEVEL_1)); + if (!spool_io_printer_info_level_1("", il->info_1, ps, depth)) + return False; + break; case 2: if (UNMARSHALLING(ps)) il->info_2=(SPOOL_PRINTER_INFO_LEVEL_2 *)malloc(sizeof(SPOOL_PRINTER_INFO_LEVEL_2)); |