diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-12 02:37:54 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-12 02:37:54 +0000 |
commit | c9d350a736ca71f838cf19386b04e972200ee595 (patch) | |
tree | fa2642eb249151bebeea09b67dd143900f5cf6ec /source3/rpc_parse | |
parent | 973c0b3257298497f2a0023d52616dab80c2317f (diff) | |
download | samba-c9d350a736ca71f838cf19386b04e972200ee595.tar.gz samba-c9d350a736ca71f838cf19386b04e972200ee595.tar.bz2 samba-c9d350a736ca71f838cf19386b04e972200ee595.zip |
Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so.
Jeremy.
(This used to be commit b63b76297835ab8227b98925fa8120ffce1a37d9)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 66252c1a19..1006a1bbee 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -2241,6 +2241,54 @@ BOOL smb_io_printer_info_3(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_3 *info, } /******************************************************************* + Parse a PRINTER_INFO_4 structure. +********************************************************************/ + +BOOL smb_io_printer_info_4(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_4 *info, int depth) +{ + prs_struct *ps=&buffer->prs; + + prs_debug(ps, depth, desc, "smb_io_printer_info_4"); + depth++; + + buffer->struct_start=prs_offset(ps); + + if (!smb_io_relstr("printername", buffer, depth, &info->printername)) + return False; + if (!smb_io_relstr("servername", buffer, depth, &info->servername)) + return False; + if (!prs_uint32("attributes", ps, depth, &info->attributes)) + return False; + return True; +} + +/******************************************************************* + Parse a PRINTER_INFO_5 structure. +********************************************************************/ + +BOOL smb_io_printer_info_5(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_5 *info, int depth) +{ + prs_struct *ps=&buffer->prs; + + prs_debug(ps, depth, desc, "smb_io_printer_info_5"); + depth++; + + buffer->struct_start=prs_offset(ps); + + if (!smb_io_relstr("printername", buffer, depth, &info->printername)) + return False; + if (!smb_io_relstr("portname", buffer, depth, &info->portname)) + return False; + if (!prs_uint32("attributes", ps, depth, &info->attributes)) + return False; + if (!prs_uint32("device_not_selected_timeout", ps, depth, &info->device_not_selected_timeout)) + return False; + if (!prs_uint32("transmission_retry_timeout", ps, depth, &info->transmission_retry_timeout)) + return False; + return True; +} + +/******************************************************************* Parse a PORT_INFO_1 structure. ********************************************************************/ @@ -2951,6 +2999,39 @@ uint32 spoolss_size_printer_info_2(PRINTER_INFO_2 *info) return the size required by a struct in the stream ********************************************************************/ +uint32 spoolss_size_printer_info_4(PRINTER_INFO_4 *info) +{ + uint32 size=0; + + size+=size_of_relative_string( &info->printername ); + size+=size_of_relative_string( &info->servername ); + + size+=size_of_uint32( &info->attributes ); + return size; +} + +/******************************************************************* +return the size required by a struct in the stream +********************************************************************/ + +uint32 spoolss_size_printer_info_5(PRINTER_INFO_5 *info) +{ + uint32 size=0; + + size+=size_of_relative_string( &info->printername ); + size+=size_of_relative_string( &info->portname ); + + size+=size_of_uint32( &info->attributes ); + size+=size_of_uint32( &info->device_not_selected_timeout ); + size+=size_of_uint32( &info->transmission_retry_timeout ); + return size; +} + + +/******************************************************************* +return the size required by a struct in the stream +********************************************************************/ + uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info) { /* The 4 is for the self relative pointer.. */ @@ -5921,6 +6002,16 @@ void free_printer_info_3(PRINTER_INFO_3 *printer) SAFE_FREE(printer); } +void free_printer_info_4(PRINTER_INFO_4 *printer) +{ + SAFE_FREE(printer); +} + +void free_printer_info_5(PRINTER_INFO_5 *printer) +{ + SAFE_FREE(printer); +} + void free_job_info_2(JOB_INFO_2 *job) { if (job!=NULL) |