I've implemented some custom marshalling for an external call so that the parameters 
being sent gets massaged as required by the external routine. In addition, it is 
supposed to massage data after the call. However, while it will do so on the way out, 
it's not being driven the other way. I found that if I specified "ref" on the 
parameters being passed then the MarshalManagedToNative method will not be driven, if 
I specify nothing or "out" then neither the ToNative or ToManaged methods are being 
called.

                [DllImport(libname, EntryPoint = "scumbag")]
                private unsafe static extern void scumbag          (ref XXXCB cb,
                        [MarshalAs(UnmanagedType.CustomMarshaler,
                         MarshalTypeRef = typeof (AdaByteBuffer))] XXXBuffer fb,
                        [MarshalAs(UnmanagedType.CustomMarshaler,
                         MarshalTypeRef = typeof (AdaByteBuffer))] XXXBuffer rb,
                        [MarshalAs(UnmanagedType.CustomMarshaler,
                         MarshalTypeRef = typeof (AdaByteBuffer))] XXXBuffer sb,
                        [MarshalAs(UnmanagedType.CustomMarshaler,
                         MarshalTypeRef = typeof (AdaByteBuffer))] XXXBuffer vb,
                        [MarshalAs(UnmanagedType.CustomMarshaler,
                         MarshalTypeRef = typeof (AdaIntBuffer))]  XXXIB ib);


Neale 
_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to