From 6d2afbcf7ac6b85a22722906f75d7e0af94e4854 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 12 Apr 2006 20:43:43 +0200 Subject: [PATCH] wineps: Load generic.ppd from the data dir if nothing else is specified. --- dlls/wineps/init.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c index 8d8305a52f..1a39356459 100644 --- a/dlls/wineps/init.c +++ b/dlls/wineps/init.c @@ -618,10 +618,21 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name) 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) {