summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-06-03 16:30:55 +0200
committerGünther Deschner <gd@samba.org>2010-06-03 16:32:49 +0200
commit30a9ddccff5b1bd1694a1a9f0e5ceebdee316d79 (patch)
treea63356c8ccae94fee232e90767dc193802521f62 /source3/utils
parent12d1a3b0a5367b4f920d32e6cb1fcdc2f7d17513 (diff)
downloadsamba-30a9ddccff5b1bd1694a1a9f0e5ceebdee316d79.tar.gz
samba-30a9ddccff5b1bd1694a1a9f0e5ceebdee316d79.tar.bz2
samba-30a9ddccff5b1bd1694a1a9f0e5ceebdee316d79.zip
s3-spoolss: add and use spoolss_printerinfo2_to_setprinterinfo2().
This fixes some invalid typecasts. Guenther
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc_printer.c12
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,