Needed to reduce the patchsize for moving AddPrinter a bit
We need to move AddPrinter to allow importing CUPS printers centralized in the spooler service (bug 3507, bug 10358)
-- bye bye ... Detlef
Signed-off-by: Detlef Riekenberg wine.dev@web.de
--- dlls/winspool.drv/info.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 9c24256..d28ca89 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -1444,7 +1444,7 @@ static void free_printer_entry( opened_printer_t *printer ) * ToDo: * - pDefault is ignored */ -static HANDLE get_opened_printer_entry(LPWSTR name, LPPRINTER_DEFAULTSW pDefault) +static HANDLE get_opened_printer_entry(LPWSTR name, LPPRINTER_DEFAULTSW pDefault, HANDLE backend_printer) { UINT_PTR handle = nb_printer_handles, i; jobqueue_t *queue = NULL; @@ -1513,10 +1513,15 @@ static HANDLE get_opened_printer_entry(LPWSTR name, LPPRINTER_DEFAULTSW pDefault }
/* get a printer handle from the backend */ - if (! backend->fpOpenPrinter(name, &printer->backend_printer, pDefault)) { - handle = 0; - goto end; + if (!backend_printer) + { + if (! backend->fpOpenPrinter(name, &printer->backend_printer, pDefault)) { + handle = 0; + goto end; + } } + else + printer->backend_printer = backend_printer;
/* clone the base name. This is NULL for the printserver */ printer->printername = strdupW(printername); @@ -2547,7 +2552,7 @@ BOOL WINAPI OpenPrinterW(LPWSTR lpPrinterName,HANDLE *phPrinter, LPPRINTER_DEFAU }
/* Get the unique handle of the printer or Printserver */ - *phPrinter = get_opened_printer_entry(lpPrinterName, pDefault); + *phPrinter = get_opened_printer_entry(lpPrinterName, pDefault, NULL);
if (*phPrinter && WINSPOOL_GetOpenedPrinterRegKey( *phPrinter, &key ) == ERROR_SUCCESS) {