[Mono-dev] [PATCH] Win32 pinvoke3 runtime tests fixes

Bill Holmes billholmes54 at gmail.com
Thu Jul 17 19:16:34 EDT 2008


Forgot to add the patch.  Sorry long day.  :(

On Thu, Jul 17, 2008 at 7:14 PM, Bill Holmes <billholmes54 at gmail.com> wrote:
> Hello All,
>
> I did some investigation on Win32 about why the pinvoke3 runtime test
> was failing.  What I found was a calling convention error in the test,
> and two struct marshaling bugs.
>
> For the calling convention problem I simply added a __stdcall
> statement in libtest.c to the function pointer declaration that was
> missing it.
>
> The two calling convention bugs I was able to handle in the epilog.
> See comments in patch for more detail.
>
> The final problem I found was similar to a problem I observed before
> when working on Winx64.  Zoltan fixed the problem with r104552 so I
> decided to take a chance and try that fix out for x86 and the problem
> went away.
>
> One last thing to point out is that this test does not even run on
> .NET.  Does this mean that Mono is better than .Net in this case?  ;)
>
> Unhandled Exception: System.Reflection.TargetInvocationException:
> Exception has been thrown by the target of an invocation. --->
> System.Runtime.InteropServices.MarshalDirectiveException: Method's
> type signature is not PInvoke compatible.
>   at Tests.mono_test_marshal_delegate2(SimpleDelegate2 d)
>   at Tests.test_0_marshal_struct_delegate()
>   --- End of inner exception stack trace ---
>   at System.RuntimeMethodHandle._InvokeMethodFast(Object target,
> Object[] arguments, SignatureStruct& sig, MethodAttributes
> methodAttributes, RuntimeTypeHandletypeOwner)
>   at System.RuntimeMethodHandle.InvokeMethodFast(Object target,
> Object[] arguments, Signature sig, MethodAttributes methodAttributes,
> RuntimeTypeHandle typeOwner)
>   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
> BindingFlags invokeAttr, Binder binder, Object[] parameters,
> CultureInfo culture, Boolean skipVisibilityChecks)
>   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
> BindingFlags invokeAttr, Binder binder, Object[] parameters,
> CultureInfo culture)
>   at TestDriver.RunTests(Type type, String[] args)
>   at TestDriver.RunTests(Type type)
>   at Tests.Main()
>
> -bill
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pinvoke3.diff
Type: application/octet-stream
Size: 3825 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080717/a0a30eea/attachment-0001.obj 


More information about the Mono-devel-list mailing list