[gs-cvs] rev 7832 - trunk/gs/src

ray at ghostscript.com ray at ghostscript.com
Sat Apr 7 13:07:46 PDT 2007


Author: ray
Date: 2007-04-07 13:07:46 -0700 (Sat, 07 Apr 2007)
New Revision: 7832

Modified:
   trunk/gs/src/gp_msprn.c
Log:
Add missing calls needed to properly send data to the printer on
Windows. Thanks to Luke Bakken for this fix. Bug 687250.

DETAILS:

Tested on Windows XP, built with MSVC 8 (Visual Studio 2005).
As Luke writes in the bug comment #5, this patch is derived
from Microsoft documentation at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_93g2.asp



Modified: trunk/gs/src/gp_msprn.c
===================================================================
--- trunk/gs/src/gp_msprn.c	2007-04-07 01:58:38 UTC (rev 7831)
+++ trunk/gs/src/gp_msprn.c	2007-04-07 20:07:46 UTC (rev 7832)
@@ -106,6 +106,11 @@
 		return;
 	    }
 	}
+	if (!StartPagePrinter(hprinter)) {
+		AbortPrinter(hprinter);
+		close(fd);
+		return;
+	}
 	if (!WritePrinter(hprinter, (LPVOID) data, count, &written)) {
 	    AbortPrinter(hprinter);
 	    close(fd);
@@ -115,6 +120,7 @@
     if (hprinter != INVALID_HANDLE_VALUE) {
 	if (count == 0) {
 	    /* EOF */
+	    EndPagePrinter(hprinter);
 	    EndDocPrinter(hprinter);
 	    ClosePrinter(hprinter);
 	}



More information about the gs-cvs mailing list