[Mono-dev] Linear layout struct containing IntPtr is not marshaled properly

Pavel Šavara pavel.savara at gmail.com
Sun Mar 21 11:21:23 EDT 2010

> You're pretending that the p/invoke is returning a struct:
> but the p/invoke is actually returning a pointer:

> But this only working by accident. Any other ABI that
> doesn't have these struct semantics will not work.

It seems like you are right

cdecl/gcc : "All structures and classes are returned in memory
regardless of complexity or size."

So my assumption that structures passed by value are really passed by
value was incorrect!

I closed bug 590014.

It would be useful to mention this behavior in Structure marshaling here

Thanks for you help

More information about the Mono-devel-list mailing list