PATCH: winspool fixes

Marcus Meissner marcus at jet.franken.de
Sun Sep 8 04:48:12 CDT 2002


Hi,

Helps WinWord 2000 printing a bit along.

License: LGPL
CHangelog:
	If the default CUPS printer has no ppd file, just use the first
	printer that has one as Windows default printer.
	Support PRINTER_ENUM_CONNECTIONS in the default way.

Index: info.c
===================================================================
RCS file: /home/wine/wine/dlls/winspool/info.c,v
retrieving revision 1.56
diff -u -r1.56 info.c
--- info.c	27 Aug 2002 22:33:09 -0000	1.56
+++ info.c	8 Sep 2002 09:47:33 -0000
@@ -131,6 +131,11 @@
 
 	if (!ppd) {
 	    WARN("No ppd file for %s.\n",printers[i]);
+	    /* If this was going to be the default printer, 
+	     * forget it and use another one.
+	     */
+	    if (def && !strcmp(def,printers[i]))
+	        def = NULL;
 	    continue;
 	}
 	unlink(ppd);
@@ -139,6 +144,14 @@
 
 	if (def && !strcmp(def,printers[i]))
 	        WINSPOOL_SetDefaultPrinter(printers[i],printers[i],FALSE);
+
+	/* The default printer has no PPD file, just use the first one
+	 * which has one.
+	 */
+	if (!def) { 
+	        WINSPOOL_SetDefaultPrinter(printers[i],printers[i],FALSE);
+		def = printers[i];
+	}
 	memset(&pinfo2a,0,sizeof(pinfo2a));
 	pinfo2a.pPrinterName	= printers[i];
 	pinfo2a.pDatatype	= "RAW";
@@ -1865,6 +1878,12 @@
     /* PRINTER_ENUM_DEFAULT is only supported under win9x, we behave like NT */
     if(dwType == PRINTER_ENUM_DEFAULT)
 	return TRUE;
+
+    if (dwType & PRINTER_ENUM_CONNECTIONS) {
+        FIXME("We dont handle PRINTER_ENUM_CONNECTIONS\n");
+	dwType &= ~PRINTER_ENUM_CONNECTIONS; /* we dont handle that */
+	dwType |= PRINTER_ENUM_LOCAL;
+    }
 
     if (!((dwType & PRINTER_ENUM_LOCAL) || (dwType & PRINTER_ENUM_NAME))) {
         FIXME("dwType = %08lx\n", dwType);



More information about the wine-patches mailing list