Replace backslashes with underscores in printer names

This commit is contained in:
David PHAM-VAN 2021-09-03 10:45:18 -03:00 committed by akallabeth
parent eb7adaec46
commit f2e14d68eb

View File

@ -300,6 +300,7 @@ static BOOL printer_load_from_config(const rdpSettings* settings, rdpPrinter* pr
void* CachedPrinterConfigData = NULL;
UINT32 CachedFieldsLen = 0;
UINT32 PrinterNameLen = 0;
WCHAR* wptr = NULL;
if (!settings || !printer)
return FALSE;
@ -359,6 +360,8 @@ static BOOL printer_load_from_config(const rdpSettings* settings, rdpPrinter* pr
if (!Stream_EnsureRemainingCapacity(printer_dev->device.data, PrinterNameLen))
goto fail;
for (wptr = wname; (wptr = _wcschr(wptr, L'\\'));)
*wptr = L'_';
Stream_Write(printer_dev->device.data, wname, PrinterNameLen);
if (!Stream_EnsureRemainingCapacity(printer_dev->device.data, CachedFieldsLen))