[Mono-bugs] [Bug 469217] New: Pointers can not reference marshaled structures.
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sun Jan 25 02:19:12 EST 2009
https://bugzilla.novell.com/show_bug.cgi?id=469217
User eugeny.grishul at gmail.com 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: mono-bugs at lists.ximian.com
ReportedBy: eugeny.grishul at gmail.com
QAContact: mono-bugs at lists.ximian.com
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.
More information about the mono-bugs
mailing list