https://bugzilla.novell.com/show_bug.cgi?id=469217
User [email protected] added comment https://bugzilla.novell.com/show_bug.cgi?id=469217#c1 Summary: Pointers can not reference marshaled structures. Classification: Mono Product: Mono: Runtime Version: 2.2.x Platform: All OS/Version: All Status: NEW Severity: Normal Priority: P5 - None Component: interop AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- User-Agent: Opera/9.63 (Windows NT 6.0; U; ru) Presto/2.1.1 Pointers to structs can't be marshalled using P/Invoke but MS VES implementation allows it. Test for MS .NET: unsafe class Program { static void Main( string[] args ) { printf( null ); } unsafe struct SomeStruct { public byte* ptr; } [DllImport( "msvcrt.dll" )] static extern void printf( SomeStruct* arr ); } Same test for mono (tested on Mac): unsafe class Program { static void Main( string[] args ) { printf( null ); } unsafe struct SomeStruct { public byte* ptr; } [DllImport( "libc.dylib" )] static extern void printf( SomeStruct* arr ); } Reproducible: Always Steps to Reproduce: 1. 2. 3. Actual Results: Unhandled Exception: System.Runtime.InteropServices.MarshalDirectiveException: Can not marshal 'parameter #1': Pointers can not reference marshaled structures. Use byref instead. Expected Results: Nothing should be printed. -- 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 - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
