[PATCH] gdi32/dc.c: modify CreateDCW to load wineddi.drv for native printer drivers (not in win.ini)

Marcel Partap mpartap at gmx.net
Sun Dec 9 17:51:04 CST 2007


---
 dlls/gdi32/dc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index 161e0df..4841d82 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -686,6 +686,8 @@ BOOL WINAPI RestoreDC( HDC hdc, INT level )
 HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
                       const DEVMODEW *initData )
 {
+    static const WCHAR winspoolW[] = { 'W','I','N','S','P','O','O','L',0 };
+    static const WCHAR wineddidrvW[] = { 'W','I','N','E','D','D','I','.','D','R','V',0 };
     HDC hdc;
     DC * dc;
     const DC_FUNCTIONS *funcs;
@@ -703,6 +705,10 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
         strcpyW(buf, driver);
     }
 
+    /* if DRIVER_GetDriverName could not find device in win.ini and 
+       driver is WINSPOOL, load ddi printer driver with wineddi.drv */
+    if (!strcmpiW( buf, winspoolW )) lstrcpyW( buf, wineddidrvW );
+
     if (!(funcs = DRIVER_load_driver( buf )))
     {
         ERR( "no driver found for %s\n", debugstr_w(buf) );
-- 
1.5.3.7


--------------000507030207060504040101--



More information about the wine-patches mailing list