[Mono-bugs] [Bug 647739] New: Marshal.PtrToStructure not working for a Structure with String or Byte Array

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Oct 19 11:13:12 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=647739

https://bugzilla.novell.com/show_bug.cgi?id=647739#c0


           Summary: Marshal.PtrToStructure not working for a Structure
                    with String or Byte Array
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jochen.kuehner at gmx.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:

I have this Structure:

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
private struct FieldDescriptor
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)]
    public string fieldName;
    public char fieldType;
    public Int32 address;
    public byte fieldLen;
    public byte count;
    public Int16 reserved1;
    public byte workArea;
    public Int16 reserved2;
    public byte flag;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
    public byte[] reserved3;
    public byte indexFlag;
}

But when I use it with Marshal.PtrToStructure i got on the Iphone the following
error:

Attempting to JIT compile method (wrapper unkown) …. While running with
-–aot-only.

I think maybe it's because of the "string" or "byte[]" datatype...

-- 
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