diff options
author | Jim McDonough <jmcd@samba.org> | 2002-12-03 19:48:18 +0000 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2002-12-03 19:48:18 +0000 |
commit | 34c7d4803330248e19c08f9a3b29395369d4199f (patch) | |
tree | e147e9c9f68081cd1c488ca0f80bda62655719a9 /source3 | |
parent | 2e6c2a1456fe50a42316d1d35f434b3b8a05e6e7 (diff) | |
download | samba-34c7d4803330248e19c08f9a3b29395369d4199f.tar.gz samba-34c7d4803330248e19c08f9a3b29395369d4199f.tar.bz2 samba-34c7d4803330248e19c08f9a3b29395369d4199f.zip |
Support printer info 7, used for publishing
(This used to be commit 3c9726454ea6beb8d5d308805caecb86395c7ad2)
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/include/rpc_spoolss.h | 16 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 63 |
2 files changed, 79 insertions, 0 deletions
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index 456825a5f5..067acd6c0f 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -989,6 +989,13 @@ typedef struct printer_info_5 } PRINTER_INFO_5; +typedef struct printer_info_7 +{ + UNISTR guid; /* text form of printer guid */ + uint32 action; +} +PRINTER_INFO_7; + typedef struct spool_q_enumprinters { uint32 flags; @@ -1480,6 +1487,14 @@ typedef struct spool_printer_info_level_3 } SPOOL_PRINTER_INFO_LEVEL_3; +typedef struct spool_printer_info_level_7 +{ + uint32 guid_ptr; + uint32 action; + UNISTR2 guid; +} +SPOOL_PRINTER_INFO_LEVEL_7; + typedef struct spool_printer_info_level { uint32 level; @@ -1487,6 +1502,7 @@ typedef struct spool_printer_info_level SPOOL_PRINTER_INFO_LEVEL_1 *info_1; SPOOL_PRINTER_INFO_LEVEL_2 *info_2; SPOOL_PRINTER_INFO_LEVEL_3 *info_3; + SPOOL_PRINTER_INFO_LEVEL_7 *info_7; } SPOOL_PRINTER_INFO_LEVEL; diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 91322a8fae..b3f136f757 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -2659,6 +2659,26 @@ BOOL smb_io_printer_info_5(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_5 *info, } /******************************************************************* + Parse a PRINTER_INFO_7 structure. +********************************************************************/ + +BOOL smb_io_printer_info_7(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_7 *info, int depth) +{ + prs_struct *ps=&buffer->prs; + + prs_debug(ps, depth, desc, "smb_io_printer_info_7"); + depth++; + + buffer->struct_start=prs_offset(ps); + + if (!smb_io_relstr("guid", buffer, depth, &info->guid)) + return False; + if (!prs_uint32("action", ps, depth, &info->action)) + return False; + return True; +} + +/******************************************************************* Parse a PORT_INFO_1 structure. ********************************************************************/ @@ -3425,6 +3445,19 @@ uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info) return the size required by a struct in the stream ********************************************************************/ +uint32 spoolss_size_printer_info_7(PRINTER_INFO_7 *info) +{ + uint32 size=0; + + size+=size_of_relative_string( &info->guid ); + size+=size_of_uint32( &info->action ); + return size; +} + +/******************************************************************* +return the size required by a struct in the stream +********************************************************************/ + uint32 spoolss_size_printer_driver_info_1(DRIVER_INFO_1 *info) { int size=0; @@ -4826,6 +4859,24 @@ BOOL spool_io_printer_info_level_2(char *desc, SPOOL_PRINTER_INFO_LEVEL_2 *il, p return True; } +BOOL spool_io_printer_info_level_7(char *desc, SPOOL_PRINTER_INFO_LEVEL_7 *il, prs_struct *ps, int depth) +{ + prs_debug(ps, depth, desc, "spool_io_printer_info_level_7"); + depth++; + + if(!prs_align(ps)) + return False; + + if(!prs_uint32("guid_ptr", ps, depth, &il->guid_ptr)) + return False; + if(!prs_uint32("action", ps, depth, &il->action)) + return False; + + if(!smb_io_unistr2("servername", &il->guid, il->guid_ptr, ps, depth)) + return False; + return True; +} + /******************************************************************* ********************************************************************/ @@ -4891,6 +4942,13 @@ BOOL spool_io_printer_info_level(char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_s return False; break; } + case 7: + if (UNMARSHALLING(ps)) + if ((il->info_7=(SPOOL_PRINTER_INFO_LEVEL_7 *)prs_alloc_mem(ps,sizeof(SPOOL_PRINTER_INFO_LEVEL_7))) == NULL) + return False; + if (!spool_io_printer_info_level_7("", il->info_7, ps, depth)) + return False; + break; } return True; @@ -6505,6 +6563,11 @@ void free_printer_info_5(PRINTER_INFO_5 *printer) SAFE_FREE(printer); } +void free_printer_info_7(PRINTER_INFO_7 *printer) +{ + SAFE_FREE(printer); +} + void free_job_info_2(JOB_INFO_2 *job) { if (job!=NULL) |