mirror of https://github.com/FreeRDP/FreeRDP
Ensure default printer for windows backend.
This commit is contained in:
parent
46d524cbc7
commit
422b684957
|
@ -317,6 +317,7 @@ static rdpPrinter** printer_win_enum_printers(rdpPrinterDriver* driver)
|
|||
int i;
|
||||
PRINTER_INFO_2* prninfo = NULL;
|
||||
DWORD needed, returned;
|
||||
BOOL haveDefault = FALSE;
|
||||
|
||||
/* find required size for the buffer */
|
||||
EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 2, NULL, 0, &needed,
|
||||
|
@ -353,9 +354,14 @@ static rdpPrinter** printer_win_enum_printers(rdpPrinterDriver* driver)
|
|||
printers = NULL;
|
||||
break;
|
||||
}
|
||||
if (current->is_default)
|
||||
haveDefault = TRUE;
|
||||
printers[num_printers++] = current;
|
||||
}
|
||||
|
||||
if (!haveDefault && (returned > 0))
|
||||
printers[0]->is_default = TRUE;
|
||||
|
||||
GlobalFree(prninfo);
|
||||
return printers;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue