diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_printer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 7d8c67fb4d..f98a6239a3 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -20,6 +20,7 @@ #include "utils/net.h" #include "../librpc/gen_ndr/cli_spoolss.h" #include "rpc_client/cli_spoolss.h" +#include "rpc_client/init_spoolss.h" #include "registry.h" #include "registry/reg_objects.h" @@ -757,6 +758,7 @@ static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd, WERROR result; NTSTATUS status; struct spoolss_SetPrinterInfoCtr info_ctr; + struct spoolss_SetPrinterInfo2 info2; struct spoolss_DevmodeContainer devmode_ctr; struct sec_desc_buf secdesc_ctr; @@ -776,8 +778,8 @@ static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd, (void *)&info->info1; break; case 2: - info_ctr.info.info2 = (struct spoolss_SetPrinterInfo2 *) - (void *)&info->info2; + spoolss_printerinfo2_to_setprinterinfo2(&info->info2, &info2); + info_ctr.info.info2 = &info2; break; case 3: info_ctr.info.info3 = (struct spoolss_SetPrinterInfo3 *) @@ -2047,6 +2049,8 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, /* do something for all printers */ for (i = 0; i < num_printers; i++) { + struct spoolss_SetPrinterInfo2 info2; + /* do some initialization */ printername = info_enum[i].info2.printername; sharename = info_enum[i].info2.sharename; @@ -2098,8 +2102,8 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, d_printf(_("creating printer: %s\n"), printername); info_ctr.level = level; - info_ctr.info.info2 = (struct spoolss_SetPrinterInfo2 *) - (void *)&info_src.info2; + spoolss_printerinfo2_to_setprinterinfo2(&info_src.info2, &info2); + info_ctr.info.info2 = &info2; result = rpccli_spoolss_addprinterex(pipe_hnd_dst, mem_ctx, |