https://bugs.winehq.org/show_bug.cgi?id=53926
Bug ID: 53926 Summary: New typelib marshaller depends on IID_IDispatch support from target interface Product: Wine Version: 7.21 Hardware: x86-64 OS: Linux Status: NEW Keywords: regression, testcase Severity: normal Priority: P2 Component: oleaut32 Assignee: wine-bugs@winehq.org Reporter: dmitry@baikal.ru CC: z.figura12@gmail.com Regression SHA1: 077b4391d442e927a2a59b5afb244355b0634aaa Distribution: ---
Created attachment 73481 --> https://bugs.winehq.org/attachment.cgi?id=73481 test (source + binary)
New typelib marshaller depends on IID_IDispatch support from target interface, however applications created with Delphi/.Net don't always follow this implication.
This is a regression, and it starts from
commit 077b4391d442e927a2a59b5afb244355b0634aaa Author: Zebediah Figura z.figura12@gmail.com Date: Fri Nov 9 18:02:00 2018 -0600
oleaut32: Rip out the old typelib marshaller.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Marcus Meissner marcus@jet.franken.de Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
Old typelib marshaller didn't have a requirement that an interface a proxy/ stub being created for must support IID_IDispatch.
Attached testcase replicates what I can deduce from the logs, and runs without failures under wine-3.0.5, but fails in several places under newer versions of Wine. The test produces 2 extra IUnknown::QueryInterface() calls under wine-3.0.5 during ::CreateStub() invocation, however it's pretty simple to fix following a FIXME in oleaut32 and stub manager in ole32, after that the test output from wine-3.0.5 matches what I observe under windows 10.
Although the test uses IConnectionPoint::Advise() to reproduce the bug (as the application that I have here does) it seems that any client<=>server remote call reliably replicates the problem, and source of the bug leads to CreateStub/CreateProxy limitations.
https://bugs.winehq.org/show_bug.cgi?id=53926
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=53926
--- Comment #1 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 73587 --> https://bugs.winehq.org/attachment.cgi?id=73587 patch
Attached patch fixes both the test and an application that I have here, and doesn't seem to break existing tests.
The patch follows what dlls/rpcrt4/ndr_typelib.c,typelib_stub_init() does, and what dlls/oleaut32/tmarshal.c,PSFacBuf_CreateStub() did in wine-3.0.5.
A more cardinal solution is to remove QueryInterface() calls in both places, however that would probably require a more convincing argument.
https://bugs.winehq.org/show_bug.cgi?id=53926
--- Comment #2 from Zeb Figura z.figura12@gmail.com --- Thanks for the detailed report. I've submitted a merge request that should hopefully fix this:
https://gitlab.winehq.org/wine/wine/-/merge_requests/1800/diffs
With the attached test it seems to get past that error, but then crashes at the "IUnknown_Release(unk)" on line 550. Since "unk" was never properly initialized I'm assuming that's the "correct" behaviour, but I never bothered testing with the old typelib marshaller.
FWIW, the patch from comment 1 is probably wrong, for reasons that are mostly described in the patch I sent, but it's annoyingly difficult to actually test.
https://bugs.winehq.org/show_bug.cgi?id=53926
--- Comment #3 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 73670 --> https://bugs.winehq.org/attachment.cgi?id=73670 typo fixes
(In reply to Zeb Figura from comment #2)
Thanks for the detailed report. I've submitted a merge request that should hopefully fix this:
https://gitlab.winehq.org/wine/wine/-/merge_requests/1800/diffs
Thank you very much for working on this. This patch on top of 1799 fixes the application that I have here.
With the attached test it seems to get past that error, but then crashes at the "IUnknown_Release(unk)" on line 550. Since "unk" was never properly initialized I'm assuming that's the "correct" behaviour, but I never bothered testing with the old typelib marshaller.
Oops, somehow I missed the crash while creating the test under Windows, it wasn't intentional, sorry about that.
While investigating some other problem (not related to this bug report) I've found a couple of other typos besides the ones fixed in MR 1799, see attached diff. Feel free to integrate them as well.
https://bugs.winehq.org/show_bug.cgi?id=53926
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |bf859fb09bba29ac1fbc9c8d923 | |77399573afc50
--- Comment #4 from Zeb Figura z.figura12@gmail.com --- Fixed upstream by https://source.winehq.org/git/wine.git/commitdiff/bf859fb09bba29ac1fbc9c8d92377399573afc50; thanks for testing.
https://bugs.winehq.org/show_bug.cgi?id=53926
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.2.
https://bugs.winehq.org/show_bug.cgi?id=53926
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x
https://bugs.winehq.org/show_bug.cgi?id=53926
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |---
--- Comment #6 from Michael Stefaniuc mstefani@winehq.org --- Removing the 8.0.x milestone from bug fixes included in 8.0.1.