[Mono-list] Custom marshalling

Alan Jenkins sourcejedi@phonecoop.coop
Sun, 25 Jul 2004 22:12:08 +0000


As far as I can tell, Mono supports custom marshalling outside of functio=
n=20
calls (like PInvoke),  - ie using Marshal.StructToPtr and PtrToStruct, bu=
t=20
you have to use UnmanagedMarshal.DefineCustom, which would involve reflec=
tion=20
of some sort - possibly creating your class with custom marshalled fields=
 by=20
reflection.

Does UnmanagedMarshal.DefineCustom work?
Is it efficient (as far as custom marshalling can be)?
Is it supported (or undocumented and likely to disappear/break)?

Would it be (technically) possible to access its functionality through an=
=20
attribute, in the same way that non-custom marshalling is done? =20
Is this likely to happen?

Alan