[Mono-bugs] [Bug 471680] Marshal.PtrToStructure() error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 2 17:14:06 EST 2009


User vargaz at gmail.com added comment

Zoltan Varga <vargaz at gmail.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |vargaz at gmail.com
         Resolution|                            |INVALID

--- Comment #3 from Zoltan Varga <vargaz at gmail.com>  2009-02-02 15:14:06 MST ---
When passing valuetypes (IntPtr is a valuetype) to methods using 
mono_runtime_invoke (), you need to pass the address of the valuetype, not the
valuetype itself, i.e.:

    void* args[1];
    void *p = &myStruct;
    args[0] = &p;

    mono_runtime_invoke (saveStructMethod, NULL, args, NULL);

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