1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +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 used to be commit 29000c1f80)
This commit is contained in:
Gerald Carter 2004-07-06 16:04:24 +00:00 committed by Gerald (Jerry) Carter
parent 776aa21df5
commit 924ddbac48

View File

@ -1914,6 +1914,7 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli,
PRINTER_INFO_CTR ctr; PRINTER_INFO_CTR ctr;
PRINTER_INFO_0 info; PRINTER_INFO_0 info;
REGISTRY_VALUE value; REGISTRY_VALUE value;
UNISTR2 data;
/* parse the command arguements */ /* parse the command arguements */
if (argc != 4) { if (argc != 4) {
@ -1951,10 +1952,11 @@ static WERROR cmd_spoolss_setprinterdata(struct cli_state *cli,
/* Set the printer data */ /* Set the printer data */
init_unistr2(&data, argv[3], UNI_STR_TERMINATE);
fstrcpy(value.valuename, argv[2]); fstrcpy(value.valuename, argv[2]);
value.type = REG_SZ; value.type = REG_SZ;
value.size = strlen(argv[3]) + 1; value.size = data.uni_str_len * 2;
value.data_p = talloc_memdup(mem_ctx, argv[3], value.size); value.data_p = talloc_memdup(mem_ctx, data.buffer, value.size);
result = cli_spoolss_setprinterdata(cli, mem_ctx, &pol, &value); result = cli_spoolss_setprinterdata(cli, mem_ctx, &pol, &value);