https://bugs.winehq.org/show_bug.cgi?id=50849
--- Comment #3 from Esme Povirk madewokherd@gmail.com --- Thanks for tracking this down. pCAInvokeMethod is declared as a _MethodInfo, which is an interface defined in the standard library. Based on signatures, I think Invoke_3 is this method:
Object Invoke(Object obj, Object[] parameters);
MSDN link: https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices._...
The Object return value is implicitly pulled into an output parameter and HRESULT return on the COM side.
Given they're accessing this through intVal, I guess they expect a VT_INT or VT_I4.
Variant marshaling goes through the Marshal.GetNativeVariantForObject method, so we can trace that to find the object being converted: [0000000000000130: 0.00000 0] ENTER:c System.Runtime.InteropServices.Marshal:GetNativeVariantForObject (object,intptr)([INT32:0000000001c596c8:0], 000000000061f2b0)
By examination of System.Variant.SetValue, that should produce a VT_I4, so something weird is going on here.