[Mono-devel-list] P/Invoke question

Julio David Quintana jdq at jdqi.com
Sun Aug 22 19:25:26 EDT 2004

I think you better file the bug report as I'm sure you can explain it a 
lot better. :)

Marcus wrote:

>No, Mono does not appear to marshal the data correctly when passing a 
>reference to an array of strings. The C# signature should be
>	private static extern int f(ref string[] data);
>if the C++ function is
>	int f(char ***data);
>I did not realize that Mono didn't support this properly until you mentioned 
>it because I was testing on Linux using Rotor (MS's "shared source" version 
>of .NET).
>If you recall, I mentioned in a previous email that the CLI spec only 
>addresses a limit set of data types that must be marshaled, and "ref 
>string[]" is not one of them. Integer and floating point types, enums, 
>strings, and pointers to them are required to be supported in both directions 
>(managed -> unmanaged and unmanaged -> managed). Arrays and delegates are 
>required to be supported in managed -> unmanaged, but not required to be 
>suppoted from unmanaged -> managed. Obviously .NET goes beyond these 
>requirements, but Mono does not implement this particular case.
>Although it isn't a bug per se, the Mono developers should probably be 
>informed about this. You could file a bug report about this. Or I can if you 
>would prefer.

More information about the Mono-devel-list mailing list