Am Sonntag, den 30.07.2006, 21:41 +0200 schrieb Detlef Riekenberg:
Printmonitors need spoolss.dll,EnumPortsW
On windows, all work is done in spoolss.dll and winspool.drv is just the Forwarder (RPC). We avoid the need for loading spoolss.dll in every App by doing the work in winspool.drv and use spoolss.dll as relay.
Changelog:
- spoolss: add EnumPortsW (by calling winspool.drv)
The Codebase in "dlls/winspool.drv/info.c" get really large and the actual Code-Path is: "winspool.drv -> CUPS/LPR" (with help from GDI).
A possible place to split the Code is at the Printmonitor-Level. The Printmonitor for the Standard "Local Ports" in Windows (COM*:, LPT*:, FILE:, Windows-File) was in "localmon.dll" and merged into "localspl.dll" with w2k.
On IRC, Alexandre already accepted to handle Wine-Specific Ports ( CUPS:*, LPR:*, Pipe to a unix_app, /unix-File ) together with the Standard Window-Ports in a single Printmonitor: "localspl.dll"
The Requirement, that updating the System-Printers in wine must work automatic, need some Attention, when the related code (LoadSystemPrinters) move from "winspool.drv" to "localspl.dll":
1) Changing the Code-Path to "winspool.drv -> localspl.dll -> CUPS/LPR" and using the same Memory-Functions for "localspl.dll" as done in Windows (the Memory-Related Exports from "spoolss.dll"), give us a circular dependency, when we load and call "winspool.drv" from "spoolss.dll". For this reason, using HeapAlloc(GetProcessHeap(), ...) and Friends from "kernel32.dll" is a Possible way to go for "localspl.dll".
2) To let Printing in Wine work as similar as possible as Printing is done in Windows, (but without RPC and without the Spooler-Service) we can change the Code-Path to "winspool.drv -> spoolss.dll -> localspl.dll -> CUPS/LPR" and use the Exports from "spoolss.dll".
Since we need the Memory-Exports from "spoolss.dll" also for other Printmonitors and many Names/Prototypes of the other "spoolss.dll" - Exports are Equal to the Functions in "winspool.drv", I prefer Solution "2".
(Wine as an EMF-Printing-Backend for samba is only Possible with 2)
As a Reference, what windows does, is: winspool.drv --(RPC)--> spoolsv.exe(Spooler Service) --(WINAPI)--> spoolss.dll -> localspl.dll -> Driver for LPT*: / COM*:
Any comments please.
Thanks