Alexandre Julliard : wineps: Load generic. ppd from the data dir if nothing else is specified.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 12 14:02:31 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 6d2afbcf7ac6b85a22722906f75d7e0af94e4854
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=6d2afbcf7ac6b85a22722906f75d7e0af94e4854

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Apr 12 20:43:43 2006 +0200

wineps: Load generic.ppd from the data dir if nothing else is specified.

---

 dlls/wineps/init.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c
index 8d8305a..1a39356 100644
--- a/dlls/wineps/init.c
+++ b/dlls/wineps/init.c
@@ -618,10 +618,21 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCST
         RegCloseKey(hkey);
     }
 
-    if (!ppdFileName) {
-        res = ERROR_FILE_NOT_FOUND;
-        ERR ("Error %li getting PPD file name for printer '%s'\n", res, name);
-        goto closeprinter;
+    if (!ppdFileName)
+    {
+        const char *data_dir, *filename;
+
+        if ((data_dir = wine_get_data_dir())) filename = "/generic.ppd";
+        else if ((data_dir = wine_get_build_dir())) filename = "/dlls/wineps/generic.ppd";
+        else
+        {
+            res = ERROR_FILE_NOT_FOUND;
+            ERR ("Error %li getting PPD file name for printer '%s'\n", res, name);
+            goto closeprinter;
+        }
+        ppdFileName = HeapAlloc( PSDRV_Heap, 0, strlen(data_dir) + strlen(filename) + 1 );
+        strcpy( ppdFileName, data_dir );
+        strcat( ppdFileName, filename );
     } else {
         res = ERROR_SUCCESS;
         if (ppdType==REG_EXPAND_SZ) {




More information about the wine-cvs mailing list