https://bugzilla.novell.com/show_bug.cgi?id=444715
Summary: Mono throws an exception when passing a generic struct (or class) to a PInvoke method Product: Mono: Runtime Version: SVN Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: generics AssignedTo: mono-bugs@lists.ximian.com ReportedBy: [EMAIL PROTECTED] QAContact: mono-bugs@lists.ximian.com Found By: --- Mono throws an exception when passing a generic struct (or class) to a PInvoke method. --- using System.Runtime.InteropServices; struct GenericStruct<T> { public int i; } class GenericPInvokeParameter { [DllImport("Kernel32")] static extern int GetCurrentThreadId(GenericStruct<byte> arg); [DllImport ("libc.so.6")] static extern int getpid (GenericStruct<byte> arg); public static void Main () { //GetCurrentThreadId (new GenericStruct<byte>()); getpid (new GenericStruct<byte>()); } } --- This code is accepted by PEVerify and executed successfully by .NET. Mono will throw an exception: Unhandled Exception: System.InvalidProgramException: Invalid IL code in (wrapper managed-to-native) GenericPInvokeParameter:getpid (GenericStruct`1): IL_0008: calli 0x00000002 at GenericPInvokeParameter.Main () [0x00000] -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - mono-bugs@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-bugs