Disable /etc/printcap parsing if no PPD file specified

Ian Pilcher ian.pilcher at home.com
Wed May 16 10:24:52 CDT 2001


I got tired of having my default printer constantly reset to 'lp' and
seeing error messages about not having a default PPD file specified.
This patch checks for a [ppd] section in the Wine config file before
trying to automatically set up the queues in /etc/printcap.

Modified files:
    dlls/winspool: info.c

Log message:
    Ian Pilcher
    Disable /etc/printcap parsing if no PPD file specified
-- 
========================================================================
Ian Pilcher                                         ian.pilcher at home.com
========================================================================
-------------- next part --------------
diff -urN ../wine-20010515cvs/dlls/winspool/info.c ./dlls/winspool/info.c
--- ../wine-20010515cvs/dlls/winspool/info.c	Wed May  9 12:10:41 2001
+++ ./dlls/winspool/info.c	Wed May 16 09:10:28 2001
@@ -275,6 +275,7 @@
 
 void
 WINSPOOL_LoadSystemPrinters() {
+    HKEY    	    	hkPPD;
     DRIVER_INFO_3A	di3a;
     di3a.cVersion = 0x400;
     di3a.pName = "PS Driver";
@@ -296,7 +297,15 @@
     if (CUPS_LoadPrinters())
 	return;
 #endif
-    PRINTCAP_LoadPrinters();
+
+    /* Check for [ppd] section in config file before parsing /etc/printcap */
+    
+    if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\ppd",
+    	    &hkPPD) == ERROR_SUCCESS)
+    {
+    	RegCloseKey(hkPPD);
+    	PRINTCAP_LoadPrinters();
+    }
 }
 
 


More information about the wine-patches mailing list