From d25aba1d144eef4fb400b730ffde308120440d17 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 21 Sep 2004 13:31:57 +0000 Subject: r2476: now that PRINTER_ATTRIBUTE_PUBLISHED does not get reset anymore, migrate the publishing-state for migrated printers as well. Therefor added client-side-support for setprinter level 7. Next will be a "net rpc printer publish"-command (just for completeness). Guenther (This used to be commit 224920738fdc65ef170152062177421cfed85bbf) --- source3/rpc_parse/parse_spoolss.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 7ae6a0d893..2b2038d16a 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -1076,6 +1076,32 @@ BOOL make_spoolss_printer_info_3(TALLOC_CTX *mem_ctx, SPOOL_PRINTER_INFO_LEVEL_3 return True; } +/******************************************************************* +create a SPOOL_PRINTER_INFO_7 struct from a PRINTER_INFO_7 struct +*******************************************************************/ + +BOOL make_spoolss_printer_info_7(TALLOC_CTX *mem_ctx, SPOOL_PRINTER_INFO_LEVEL_7 **spool_info7, + PRINTER_INFO_7 *info) +{ + + SPOOL_PRINTER_INFO_LEVEL_7 *inf; + + /* allocate the necessary memory */ + if (!(inf=(SPOOL_PRINTER_INFO_LEVEL_7*)talloc(mem_ctx, sizeof(SPOOL_PRINTER_INFO_LEVEL_7)))) { + DEBUG(0,("make_spoolss_printer_info_7: Unable to allocate SPOOL_PRINTER_INFO_LEVEL_7 struct!\n")); + return False; + } + + inf->guid_ptr = (info->guid.buffer!=NULL)?1:0; + inf->action = info->action; + init_unistr2_from_unistr(&inf->guid, &info->guid); + + *spool_info7 = inf; + + return True; +} + + /******************************************************************* * read a structure. * called from spoolss_q_open_printer_ex (srv_spoolss.c) @@ -4149,6 +4175,10 @@ BOOL make_spoolss_q_setprinter(TALLOC_CTX *mem_ctx, SPOOL_Q_SETPRINTER *q_u, q_u->secdesc_ctr->sec = secdesc; break; + case 7: + make_spoolss_printer_info_7 (mem_ctx, &q_u->info.info_7, info->printers_7); + break; + default: DEBUG(0,("make_spoolss_q_setprinter: Unknown info level [%d]\n", level)); break; -- cgit