From 924ddbac4826078066e07b4dc7f928cc65bff00a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 6 Jul 2004 16:04:24 +0000 Subject: r1361: patch from Guenther Deschner to ensure that REG_SZ values in the SetPrinterData actually get written in UNICODE strings rather than ASCII (This used to be commit 29000c1f800c35d5434b39b7c76fe7f10afaaecc) --- source3/rpcclient/cmd_spoolss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/rpcclient/cmd_spoolss.c') diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index 0d6740257d..38558ec3d4 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -1914,6 +1914,7 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli, PRINTER_INFO_CTR ctr; PRINTER_INFO_0 info; REGISTRY_VALUE value; + UNISTR2 data; /* parse the command arguements */ if (argc != 4) { @@ -1951,10 +1952,11 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli, /* Set the printer data */ + init_unistr2(&data, argv[3], UNI_STR_TERMINATE); fstrcpy(value.valuename, argv[2]); value.type = REG_SZ; - value.size = strlen(argv[3]) + 1; - value.data_p = talloc_memdup(mem_ctx, argv[3], value.size); + value.size = data.uni_str_len * 2; + value.data_p = talloc_memdup(mem_ctx, data.buffer, value.size); result = cli_spoolss_setprinterdata(cli, mem_ctx, &pol, &value); -- cgit