1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-05 12:23:50 +03:00

r1361: patch from Guenther Deschner <gd@sernet.de> to ensure that REG_SZ values in the SetPrinterData actually get written in UNICODE strings rather than ASCII

This commit is contained in:
Gerald Carter
2004-07-06 16:04:24 +00:00
committed by Gerald (Jerry) Carter
parent d7b2e41f00
commit 29000c1f80

View File

@@ -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);