Hi.
Printing in wine use gdi32.dll, gdi.exe, winspool.drv and wineps.drv as Printer-Driver with CUPS/LPR as backend.
Many things are not correct (See: http://wiki.winehq.org/Printing ).
After some Patches, Wine is able to manage Printmonitors.
With the current work, a framework is added and wine start to use the Printmonitors to manage the Printerports. (Patch for wine-0.9.18, should also work for current HEAD)
I used various monitors for testing: 1: redmonnt.dll from RedMon 1.7 2: pdfcmnnt.dll from PDFCreator 0.9.2 3: localspl.dll from w2ksp4 4: a partial portmonitor for local Ports, added to winspool.drv
You can use a native printui.dll and play with the "Ports"-Page wine rundll32.exe printui.dll,PrintUIEntry /s
Some notes about the Patch. - FAR is used in "ddk/winsplp.h", but this does not work with wine. I removed that Keyword, but it is still present in the w2k3ddk An alternative would be "#define FAR" and "#undef FAR" around '#include "ddk/winsplp.h"' in "dlls/winspool.drv/info.c". Another Idea?
- The Spooler-Configuration was still using the Path from the old config - File. (Software\Wine\Wine\Config\Spooler<Portname>) Do we still need this? (A clean way is a seperate Portmonitor)
- native localspl.dll need a vailid Section [Ports] in "win.ini" to load. (I used "FILE:=" and "LPT1:=" as entries)
- Only Portmonitors, that use "InitializePrintMonitor" are supported. "InitializePrintMonitorUI" requires a "InitializePrintMonitor2" to be implemented, but this is a later step.
- AddPort/ConfigurePort/DeletePort in localspl.dll need support for "InitializePrintMonitor2" and all around XcvData.
- AddPort/ConfigurePort/DeletePort in the internal Portmonitor is not complete. (As Example, I simple reuse the "Save to File" - Dialog)
- The codebase for winspool.drv is really large (>240k) and I want to split the source. The correct way is creating "localspl.dll" for the local Portmonitor (as w2k and above) and another dll for the CUPS/LPR - Handling (and maybe Software\Wine\Wine\Config\Spooler<Portname>). A different fast hack is simple a new sourcefile for "winspool.drv" for a CUPS/LPR-Monitor and a local Portmonitor.
- the internal Portmonitor uses the Registry, where the Ports - Section from "win.ini" is redirected by "IniFileMapping" on windows.
- The Ports for the used CUPS/LPR - Printers is a later issue, when wine starts to use the managed Ports.
Please try this Patch and point your Ideas and Hints here, so I can split the code into a set of Patches that can go clean into the Tree.
Thanks to all for your Help