Improve Printing with Wine

Printing in Windows-NT

Printing works with:

  • GDI32.DLL together with

  • various Printer-Drivers,

  • the Spooler-Client-API (WINSPOOL.DRV),

  • the Spooler-Service (SPOOLSS.EXE with SPOOLSS.DLL),

  • a Printprocessor (WinPrint, included in LOCALSPL.DLL),

  • a Printprovider (LOCALSPL.DLL or WIN32SPL.DLL) and

  • a (Port-)Monitor (USBMON.DLL or LOCALMON.DLL/LOCALSPL.DLL) with

  • a (Port-)Monitor User Interface (LOCALUI.DLL)

  • together with the Printing-Dialogs (comdlg32.dll and compstui.dll)

  • and the Printer Management User Interface (PRINTUI.DLL)


Printing in Wine

Wine provides printing with:

  • GDI32.DLL together with

  • the Client-API (WINSPOOL.DRV),

  • the buildin Postscript-Driver (WINEPS.DRV) and

  • on the Unix-Side, (CUPS or LPR (BSD-Based Printing) as Backend.

    • The "Local Port" Monitor (LOCALSPL.DLL) was started

  • the "Local Port Monitor User Interface" (LOCALUI.DLL) need a frontend (printui.dll)


What's wrong with Printing in Wine

  • wineps.drv use some of the old 16-Bit code (A copy of GDI.EXE,WriteSpool16 as Example)

  • We are fixed to wineps.drv, and we do that in a Wine-Specific way

    • What about virtual PDF-Printer?
    • We are fixed to Postscript
      • There are several Questions from Users: "How to do RAW Printing"
  • We are using the Win3.1 Style API for Printer-Drivers
    • GDI32.DLL must call WINSPOOL.DRV for all Printer-Functions

  • We have too many BUGS in Printing
    • Some recent Bugs:
    • List all BUGS for printing

    • Coverity reports some Defects for winspool.drv

    • There are some Cross Calls W to A

      • (They will be fixed during the updates of winspool.drv)

    • Every Printing App enumerates the Host Printers while loading winspool.drv
      • We should do that once in a Wine session in the spooler service SPOOLSS.EXE/SPOOLSS.DLL


What we do not need / will not support

  • Different Printprovider (Remote-Printing)
    • CUPS and LPR can forward our Data
  • The Windows Spooler-Service
    • CUPS and LPR are fine as Spooler
  • RPC between WINSPOOL.DRV and SPOOLSS.EXE/SPOOLSS.DLL

  • A PIPE between an Application and SPOOLSS.EXE/SPOOLSS.DLL


What about Windows Printer-Drivers in wine

  • This would be nice, but we have still many unimplemented Functions
  • Some years ago, 16-Bit Drivers (Windows 3.1) are reported to work
  • There is a CUPS-Backend named ddiwrapper in SUSE, that use a modified wine

    • (gdi32.dll and winspool.drv are replaced) to print with recent Native Printer-Drivers (Cannon-Printers are reported to work)
  • Wine is using a different API to communicate with the Wine Printer Driver


Work in Progress

  • winspool.drv
    • (./) AddMonitor is implemented (19. Jun. 2006)

    • (./) AddPort is implemented (16. Jan 2007)

    • (./) AddPortEx is implemented (05. Jun 2007)

    • (./) AddPrinterDriver is implemented (24. Aug. 2007)

    • (./) AddPrinterDriverEx is implemented (23. Aug. 2007)

    • (./) ConfigurePort is implemented (12. Jan 2007)

    • (./) DeletePort is implemented (16. Jan 2007)

    • {X} DevicePropertySheets is not implemented

      • Patch for a stub send (9. Jun. 2006)

    • {X} DocumentPropertySheets is not implemented

      • Patch for a stub send (9. Jun. 2006)

    • {X} EnumForms is a stub

      • Patch for the Testsuite accepted

    • (./) EnumMonitors is implemented (31. Mar. 2006)

    • (./) EnumPorts is implemented (06. Nov. 2006)

    • (./) EnumPrintProcessors is implemented (15. Oct. 2009)

    • {X} FindClosePrinterChangeNotification is not implemented

    • {X} FindFirstPrinterChangeNotification is not implemented

    • {X} FindNextPrinterChangeNotification is not implemented

    • (./) GetPrintProcessorDirectory is implemented (10. Jun. 2006)

    • (./) OpenPrinter is implemented

      • {X} Does not use the Monitor for the Port

    • {X} ReadPrinter is not implemented

    • {X} SetDefaultPrinter is not implemented

    • {X} WritePrinter is not implemented

    • (./) XcvDataW is implemented (06. Jan 2007)

  • localspl.dll
    • (./) InitializePrintMonitor is implemented (20. Oct. 2006)

      • pfnAddPort is obsolete: Use pfnAddPortUI from localui.dll
      • (./) pfnAddPortEx is implemented (14. Jun 2007)

      • (./) pfnClosePort is implemented (11. Sep 2007)

      • pfnConfigurePort is obsolete: Use pfnConfigurePortUI from localui.dll
      • pfnDeletePort is obsolete: Use pfnDeletePortUI from localui.dll
      • {X} pfnEndDocPort is not implemented

      • (./) pfnEnumPorts is implemented (31. Oct 2006)

      • {X} pfnGetPrinterDataFromPort is not implemented

      • (./) pfnOpenPort is implemented (11. Sep 2007)

      • pfnOpenPortEx is only for a Language Monitor
      • {X} pfnReadPort is not implemented

      • {X} pfnSetPortTimeOuts is not implemented

      • {X} pfnStartDocPort is not implemented

      • {X} pfnWritePort is not implemented

      • (./) pfnXcvOpenPort is implemented (17. Jan 2007)

      • (./) pfnXcvDataPort is nearly complete implemented (17. Jan 2007)

        • (./) cmd: AddPort (18. Apr 2007)

        • (./) cmd: ConfigureLPTPortCommandOK (20. Feb 2007)

        • (./) cmd: DeletePort (07. Mar 2007)

        • (./) cmd: GetDefaultCommConfig (20. Feb 2007)

        • (./) cmd: GetTransmissionRetryTimeout (20. Feb 2007)

        • (./) cmd: MonitorUI (17. Jan 2007)

        • (./) cmd: PortIsValid (17. Jan 2007)

        • {X} cmd: PortExists

        • (./) cmd: SetDefaultCommConfig (20. Feb 2007)

      • (./) pfnXcvClosePort is implemented (17. Jan 2007)

  • localui.dll
    • (./) InitializePrintMonitorUI is implemented (09. Apr 2007)

      • (./) pfnAddPortUI is implemented (01. Mai 2007)

      • (./) pfnConfigurePortUI is implemented (05. Mai 2007)

      • (./) pfnDeletePort is implemented (18. Apr 2007)

  • printui.dll
    • The Printer-Queue Window, Printer-Management from the Commandline and much more.
  • compstui.dll
    • This DLL is required since NT 4.0 to provide the standard Property-Sheets for "Printer-Properties" / "Document Settings"
    • {X} CommonPropertySheetUI is a stub

    • {X} All Bitmap-Resources are absent

    • {X} All String-Resources are absent


Issues in other DLL's, that affect Printing
  • comdlg32.dll
    • {X} We have not enough tests

    • {X} PrintDlgEx is a stub

      • This is the new Printer-Selector for Applications since w2k
      • Bug #4342: PrintDlgEx* unimplemented

      • The standard Property-Sheets are implemented in compstui.dll

  • kernel32.dll
    • {X} IniFileMapping is not implemented

  • shell32.dll
    • {X} The Printer-Folder is not implemented

    • {X} Dialog "Printer-Properties" is not implemented

    • {X} Dialog "Document-Properties" is not implemented

    • {X} Dialog "Job-Properties" is not implemented


Nice to have
  • wineps.drv
    • (!) Creating Property-Sheets from PPD-Informations would be nice (Forms, Quality)

    • (!) A Property-Sheet to select a specific PPD-File would be nice

  • winecfg.exe
    • (!) Nice would be a Printing-Page to redirect a Port to a Unix-File or Pipe it to a Unix-App


See Also
  • PDF in this Wiki

  • printui in this Wiki: Printer-Management on the commandline

  • [RedMon] in this Wiki

  • RedMon 1.7 in the AppDB


Workers: DetlefRiekenberg


CategoryDevelopment

Printing (last edited 2012-07-25 20:31:07 by KyleAuble)