https://bugs.winehq.org/show_bug.cgi?id=54379
Bug ID: 54379 Summary: since wine 8.0 print doesn't work any more Product: Wine Version: 8.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: spam@abma.de Distribution: ---
after upgrading to wine 8.0 printing to a network printer doesn't work any more.
with wine 7.0 printing the same on the same printer just works.
i've run the app with:
WINEDEBUG=+winprint
see attachment:
not sure if relevant, what looks suspicious:
OpenPrintProcessor L", Port", 0740D014
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #1 from Matthias spam@abma.de --- Created attachment 73947 --> https://bugs.winehq.org/attachment.cgi?id=73947 partial trace
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #2 from abma spam@abma.de --- to make print work again, set the default value of
HKEY_CURRENT_USER\Software\Wine\Printing\Spooler
to: CUPS:printername
https://github.com/wine-mirror/wine/blob/master/dlls/localspl/provider.c#L37...
so, it seems that cups network printers don't have a portname set
https://bugs.winehq.org/show_bug.cgi?id=54379
abma spam@abma.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |spooler
https://bugs.winehq.org/show_bug.cgi?id=54379
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression
--- Comment #3 from Austin English austinenglish@gmail.com --- Please run a regression test: https://wiki.winehq.org/Regression_Testing
https://bugs.winehq.org/show_bug.cgi?id=54379
MaranBr maranbr@outlook.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |maranbr@outlook.com
--- Comment #4 from MaranBr maranbr@outlook.com --- To be more specific, printing is not working for some softwares since Wine 7.22 (Devel). In the current Wine 8.0 (Stable) it doesn't work either.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #5 from MaranBr maranbr@outlook.com --- (In reply to abma from comment #2)
to make print work again, set the default value of
HKEY_CURRENT_USER\Software\Wine\Printing\Spooler
to: CUPS:printername
https://github.com/wine-mirror/wine/blob/master/dlls/localspl/provider. c#L3716
so, it seems that cups network printers don't have a portname set
It does not work for me. I keep having the same issue even though I added this key in the registry.
I created a clean profile and added only the "CUPS:PDF" printer. But it didn't work either.
There seems to be an issue where Wine is erroneously leaving the printer port blank in the course of code execution, so the printer fails and prints nothing.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #6 from MaranBr maranbr@outlook.com --- Created attachment 74015 --> https://bugs.winehq.org/attachment.cgi?id=74015 Trace file of print processor
Printer trace file with empty port situation. At the end of the process, nothing happens and no files are printed.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #7 from MaranBr maranbr@outlook.com --- From what I was investigating, at some point in the execution of the code, some variables needed by the print processor become blank:
Port DocName OutputFile Datatype
Causing this situation:
0374:trace:winspool:StartDocPrinterW (00000003, 1, 0021F008 {L"", L"", (null)}) 0374:trace:localspl:fpStartDocPrinter (01532730 1 0021F008 {pDocName = L"", pOutputFile = L"", pDatatype = (null)})
0374:trace:localspl:fpScheduleJob need to schedule job 1 filename L"C:\windows\system32\spool\PRINTERS\00001.SPL" to port L""
0374:trace:winprint:OpenPrintProcessor L", Port", 0021DF54 0374:trace:winspool:OpenPrinter2W (L", Port",0021DECC,00000000,00000000) 0374:trace:localspl:fpOpenPrinter (L", Port", 01532B74, 00000000) 0374:trace:localspl:monitor_load_by_port (L"")
The process is completed, but nothing is printed.
https://bugs.winehq.org/show_bug.cgi?id=54379
Eugene Savelov savelov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |savelov@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #8 from Eugene Savelov savelov@gmail.com --- for me it also happens, with SAMO Touragent application https://appdb.winehq.org/objectManager.php?sClass=version&iId=14824 will try to run regression test
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #9 from Eugene Savelov savelov@gmail.com --- 1cf1412a12c6ee6191d387162fecb456f0df2d89 is the first bad commit commit 1cf1412a12c6ee6191d387162fecb456f0df2d89 Author: Piotr Caban piotr@codeweavers.com Date: Mon Nov 21 12:45:33 2022 +0100
gdi32: Get printer output file name in StartDoc.
dlls/gdi32/Makefile.in | 2 +- dlls/gdi32/dc.c | 57 +++++++++++++++++++++++++++++++++++++++++++------- include/ntgdi.h | 2 ++ 3 files changed, 53 insertions(+), 8 deletions(-)
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #10 from Eugene Savelov savelov@gmail.com --- after bad commit, when working incorrectly, wine generates postscript files in current directory, instead of sending them to printer, with invalid names
-rw-rw-r-- 1 eugene eugene 755580 фев 14 08:52 'ì§ Â¥Â¸'$'\302\231' -rw-rw-r-- 1 eugene eugene 752611 фев 14 09:05 'È'$'\302\231''¸'$'\302\231''¸'$'\302\231''¨'$'\302\231' -rw-rw-r-- 1 eugene eugene 752611 фев 14 21:27 '¸'$'\302\231''¨'$'\302\231' -rw-rw-r-- 1 eugene eugene 752611 фев 14 21:29 '¨'$'\302\231\302\230\302\231'
https://bugs.winehq.org/show_bug.cgi?id=54379
abma spam@abma.de changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=54467
https://bugs.winehq.org/show_bug.cgi?id=54379
whatbug n296869@rtrtr.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |n296869@rtrtr.com
--- Comment #11 from whatbug n296869@rtrtr.com --- *** Bug 54467 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #12 from whatbug n296869@rtrtr.com --- Same problem here. I just closed #54467 because it seems to be a duplicate of this bug. In short:
-CUPS doesn't receive print-jobs from wine anymore -In wine, there are files created in: $HOME/.wine/drive_c/windows/system32/spool/printers/ - so spooling is actually happening but not sent. -I tried the registry-modification, mentioned earlier in this bug-report - no success. -I tried creating a new bottle and get mixed results: First, I couldn't print to boomaga only and not with the real printer. However, it depended on application if boomage received the job in color or b/w-only. Right now wine IS printing on the real printer for the first time! Don't know why and how.
Maybe because I installed some additional libs for some other application yesterday?
However, printing with my primary wine-prefix still isn't possible. So I assume the conversion-process of the wine bottle (which happens the first time of starting a wine-application, after wine-update), seems to be faulty.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #13 from Eugene Savelov savelov@gmail.com --- is it just a typo in this patch?
https://gitlab.winehq.org/wine/wine/-/commit/1cf1412a12c6ee6191d387162fecb45...
on line 273, should be
if (output) memcpy( port, output, output_str.Length );
instead of
if (port) memcpy( port, output, output_str.Length );
as in memcpy first argument (port) is destination, so it makes no sense in checking it for not-NULL, instead need to check second argument (output), which is the source
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #14 from whatbug n296869@rtrtr.com --- Wow! It's Sherlock Holmes! We need a dev here who knows the Code!
https://bugs.winehq.org/show_bug.cgi?id=54379
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |1cf1412a12c6ee6191d387162fe | |cb456f0df2d89 CC| |piotr@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=54379
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com
--- Comment #15 from Piotr Caban piotr.caban@gmail.com --- (In reply to Eugene Savelov from comment #13)
is it just a typo in this patch?
https://gitlab.winehq.org/wine/wine/-/commit/ 1cf1412a12c6ee6191d387162fecb456f0df2d89#2ca91ec591036cfc37280681ab0602cab666 64e1_254_273
No, this patch is correct in this regard (port is NULL when output is NULL).
There was an regression caused by 1cf1412a12c6ee6191d387162fecb456f0df2d89 and fixed by b6204639ba864231bd14164363613963a9696278 (gdi32: NULL terminate output string in CreateDCW).
It might be useful to do regression test starting from b6204639ba864231bd14164363613963a9696278 commit if printing works with it.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #16 from Piotr Caban piotr.caban@gmail.com --- (In reply to MaranBr from comment #6)
Created attachment 74015 [details] Trace file of print processor
The problem is visible in this line: 0374:trace:winspool:StartDocPrinterW (00000003, 1, 0021F008 {L"", L"", (null)})
Supplied DOC_INFO_1 structure passes empty string as pOutputFile. Probably we should handle empty string in the same way as NULL here but I will need to run some tests. Because of that, later, we're trying to use empty string as port name.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #17 from Piotr Caban piotr.caban@gmail.com --- I have verified that printing is also not working in Wine 7.21 when empty string is passed as pOutputFile to StartDoc function. This means that probably empty string was not passed there in some older versions of wine (or some workarounds like modifying default HKEY_CURRENT_USER\Software\Wine\Printing\Spooler value were used).
This leads to few questions: - does printing from notepad using clean prefix work? - is it possible to print from notepad using old prefix? - if printing is not working in specific application, please provide its name
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #18 from Eugene Savelov savelov@gmail.com --- for me, printing from notepad works, but does not work from SAMO Touragent application https://appdb.winehq.org/objectManager.php?sClass=version&iId=14824 (quite old Delphi app)
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #19 from Eugene Savelov savelov@gmail.com --- (In reply to Piotr Caban from comment #15)
(In reply to Eugene Savelov from comment #13)
is it just a typo in this patch?
https://gitlab.winehq.org/wine/wine/-/commit/ 1cf1412a12c6ee6191d387162fecb456f0df2d89#2ca91ec591036cfc37280681ab0602cab666 64e1_254_273
No, this patch is correct in this regard (port is NULL when output is NULL).
There was an regression caused by 1cf1412a12c6ee6191d387162fecb456f0df2d89 and fixed by b6204639ba864231bd14164363613963a9696278 (gdi32: NULL terminate output string in CreateDCW).
It might be useful to do regression test starting from b6204639ba864231bd14164363613963a9696278 commit if printing works with it.
I was doing git bisect regression between 7.21 and 7.22, and printing did not work after the 1cf1412a12c6ee6191d387162fecb456f0df2d89, but worked before it.
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #20 from Eugene Savelov savelov@gmail.com --- (In reply to Piotr Caban from comment #16)
(In reply to MaranBr from comment #6)
Created attachment 74015 [details] Trace file of print processor
The problem is visible in this line: 0374:trace:winspool:StartDocPrinterW (00000003, 1, 0021F008 {L"", L"", (null)})
Supplied DOC_INFO_1 structure passes empty string as pOutputFile. Probably we should handle empty string in the same way as NULL here but I will need to run some tests. Because of that, later, we're trying to use empty string as port name.
after applying below fix on wine 8.2 printing now works!
--- dlls/gdi32/dc.orig.c 2023-02-20 00:09:19.960931092 +0300 +++ dlls/gdi32/dc.c 2023-02-20 00:11:48.483031851 +0300 @@ -274,6 +274,7 @@ { memcpy( port, output, output_str.Length ); port[output_str.Length / sizeof(WCHAR)] = 0; + if (output_str.Length == 0) port = NULL; } dc_attr->hspool = HandleToULong( hspool ); dc_attr->output = (ULONG_PTR)port;
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #21 from Piotr Caban piotr.caban@gmail.com --- (In reply to MaranBr from comment #6)
Created attachment 74015 [details] Trace file of print processor
Could you please attach similar log from older wine where printing works? I still can't see what port stopped working (because passing "" as output file was not working in wine 7.0 and 7.21).
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #22 from MaranBr maranbr@outlook.com --- Created attachment 74086 --> https://bugs.winehq.org/attachment.cgi?id=74086 Trace file of print processor (Wine 7.0.1 Stable)
Trace file of print processor using Wine 7.0.1 Stable
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #23 from Piotr Caban piotr.caban@gmail.com --- (In reply to MaranBr from comment #22)
Trace file of print processor using Wine 7.0.1 Stable
Thank you. I think I know where the problem is. The application passes pszPort="" to CreateDC while creating printer DC. So the regression is caused by if (!info.lpszOutput) info.lpszOutput = (const WCHAR *)(ULONG_PTR)dc_attr->output; line. I will work on fixing it.
Could you please attach one more log with following debug channels: winspool,localspl,gdi,commdlg,module using wine 8.0 or newer?
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #24 from Piotr Caban piotr.caban@gmail.com --- It should be fixed by: https://gitlab.winehq.org/wine/wine/-/merge_requests/2251
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #25 from Eugene Savelov savelov@gmail.com --- Created attachment 74100 --> https://bugs.winehq.org/attachment.cgi?id=74100 winspool logfile against latest master
Tested printing against latest master, printing works fine, but got bad file descriptor errors in the end - visible in russian locale
https://bugs.winehq.org/show_bug.cgi?id=54379
--- Comment #26 from Eugene Savelov savelov@gmail.com --- tested against wine 8.3, print works correctly against cups-pdf
https://bugs.winehq.org/show_bug.cgi?id=54379
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |48d3271f963319b6e45eeaf18b4 | |4ac1a1bd3c190 Resolution|--- |FIXED
--- Comment #27 from Piotr Caban piotr.caban@gmail.com --- Fixed by 48d3271f963319b6e45eeaf18b44ac1a1bd3c190.
https://bugs.winehq.org/show_bug.cgi?id=54379
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |skycap1501@gmail.com
--- Comment #28 from Vijay Kamuju infyquest@gmail.com --- *** Bug 54461 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=54379
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #29 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.4.
https://bugs.winehq.org/show_bug.cgi?id=54379
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x
https://bugs.winehq.org/show_bug.cgi?id=54379
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |---
--- Comment #30 from Michael Stefaniuc mstefani@winehq.org --- Removing the 8.0.x milestone from bug fixes included in 8.0.1.