From c9d350a736ca71f838cf19386b04e972200ee595 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 12 Jan 2002 02:37:54 +0000 Subject: Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so. Jeremy. (This used to be commit b63b76297835ab8227b98925fa8120ffce1a37d9) --- source3/rpc_parse/parse_spoolss.c | 91 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'source3/rpc_parse/parse_spoolss.c') 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 @@ -2240,6 +2240,54 @@ BOOL smb_io_printer_info_3(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_3 *info, return True; } +/******************************************************************* + 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. ********************************************************************/ @@ -2947,6 +2995,39 @@ uint32 spoolss_size_printer_info_2(PRINTER_INFO_2 *info) return size; } +/******************************************************************* +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 ********************************************************************/ @@ -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) -- cgit