Commit d6d0239f authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

winspool: Error check in add_printer_driver() was to strict.

Reported by Dan Sawyer.
parent efdc1168
......@@ -486,18 +486,21 @@ static BOOL add_printer_driver(const char *name)
di3a.pConfigFile = driver_nt;
di3a.pDefaultDataType = default_data_type;
if (AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a))
if (AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a) ||
(GetLastError() == ERROR_PRINTER_DRIVER_ALREADY_INSTALLED ))
{
di3a.cVersion = 0;
di3a.pEnvironment = env_9x;
di3a.pDriverPath = driver_9x;
di3a.pConfigFile = driver_9x;
if (AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a))
if (AddPrinterDriverA(NULL, 3, (LPBYTE)&di3a) ||
(GetLastError() == ERROR_PRINTER_DRIVER_ALREADY_INSTALLED ))
{
return TRUE;
}
}
ERR("Failed adding driver %s: %u\n", debugstr_a(di3a.pDriverPath), GetLastError());
ERR("Failed adding driver %s (%s): %u\n", debugstr_a(di3a.pDriverPath),
debugstr_a(di3a.pEnvironment), GetLastError());
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment