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

This commit is contained in:
Alexandre Julliard 2006-04-12 20:43:43 +02:00
parent 35bca77f47
commit 6d2afbcf7a

View File

@ -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) {