Can't marshal a structure in monotouch
===

I have the following structure that is defined in a header file for a library that a vendor has given to us.

      typedef struct {
        int iLen;
        int iType;
        int state;
        unsigned char data[1200];
      } TCardCmdRespond;

I have created a structure in C# that I think matches it.

    [StructLayout(LayoutKind.Sequential)]
    public struct TCardCmdRespond
    {
		public int iLen;
        public int iType;
        public int state;
        public byte[] data;
    }

A few notes here.  I am not sure what an unsigned char array should map to.  I guessed that unsigned char should map to char but char in C# is Unicode so that doesn't seem like it would work.  I also tried byte.  I also don't know if the length 1200 will be significant to the marshaler and if so, how to designate it.

I have the following method in my monotouch app.

		[Export("OnRecvData:")]
		public void OnRecvData(TCardCmdRespond respond)
		{
		    ...
		}

The method is invoked via a selector and I can get the method to be invoked by the library just fine.  The problem arises when I look at the data contained in the structure.  The numbers are extremely high when I am expecting them to be 1-3.  I have tried using bit-converter to reverse the byte order in case it is an endianness problem that the marshaler didn't solve for me.

Further problems arise when I try to pull the data out of the char array.  It isn't null but trying to access it in any way beyond a null check crashes the application with an EXC_BAD_ACCESS (SIGABRT)

My workaround solution is to write a wrapper for this in objective-c that breaks the structure apart into parameters instead.  Then create a library that wraps it up and bind that instead.  My objective-c skills are not so hot and that is a slow process however.

Is there a way that I can make this work without having to wrap this up in an objective-c library?