The attached patch removes the explicit load of the PostScript driver
from MAIN_GdiInit. Instead, when a function calls DRIVER_FindDriver to
get a drivers DC_FUNCTIONS, DRIVER_FindDriver will attempt to load a
named driver if it hasn't already registered itself.
This appears to work for printing from Lotus Notes. I'd appreciate some
feedback from people using other applications, however.
Also, any thoughts on the approach in general would be welcome. Thanks!
--
========================================================================
Ian Pilcher pilcher@concentric.net
========================================================================
--- ../wine-20010226cvs/graphics/driver.c Mon Nov 27 17:54:29 2000
+++ graphics/driver.c Tue Feb 27 18:34:08 2001
@@ -54,15 +54,25 @@
*/
const DC_FUNCTIONS *DRIVER_FindDriver( LPCSTR name )
{
- GRAPHICS_DRIVER *driver = firstDriver;
+ GRAPHICS_DRIVER *driver;
+ HINSTANCE hDriver;
TRACE(": %s\n", name);
- while (driver && name)
- {
+
+ if (!name) return genericDriver ? genericDriver->funcs : NULL;
+
+ for (driver = firstDriver; driver; driver = driver->next)
if (!strcasecmp( driver->name, name )) return driver->funcs;
- driver = driver->next;
- }
- return genericDriver ? genericDriver->funcs : NULL;
+
+ if (!(hDriver = LoadLibraryA (name))) return NULL;
+
+ for (driver = firstDriver; driver; driver = driver->next)
+ if (!strcasecmp( driver->name, name )) return driver->funcs;
+
+ if (!FreeLibrary (hDriver))
+ WARN ("FreeLibrary failed with code %li\n", GetLastError ());
+
+ return NULL;
}
--- ../wine-20010226cvs/dlls/gdi/gdi_main.c Fri Jan 26 14:43:43 2001
+++ dlls/gdi/gdi_main.c Tue Feb 27 18:19:44 2001
@@ -24,9 +24,6 @@
/* Create the Win16 printer driver */
if (!WIN16DRV_Init()) return FALSE;
- /* PSDRV initialization */
- if (!LoadLibraryA( "wineps" )) return FALSE;
-
return TRUE;
}