RIL troubles

Giuliano Peretti posted at 07-May-08 11:46
Hi all,
i am in trouble with RIL, that is, i am not able to define "RILREMOTEPARTYINFO" data structure, writing:
    class RILADDRESS
    {
      [FieldOffset(0)]
      public uint dwSize;
      [FieldOffset(4)]
      public uint dwParams;
      [FieldOffset(8)]
      public uint dwType;
      [FieldOffset(12)]
      public uint dwNumPlan;
      [FieldOffset(16)]
      public byte[] sAddress = new byte[256 * 2];
      //[FieldOffset(528)]
    }

    [StructLayout(LayoutKind.Explicit)]
    class RILSUBADDRESS
    {
      [FieldOffset(0)]
      public uint dwSize;
      [FieldOffset(4)]
      public uint dwParams;
      [FieldOffset(8)]
      public uint dwType;
      [FieldOffset(12)]
      public byte[] sSubAddress = new byte[256 * 2];
      //[FieldOffset(524)]
    }
    class RILREMOTEPARTYINFO
    {
      [FieldOffset(0)]
      public uint dwSize;
      [FieldOffset(4)]
      public uint dwParams;
      [FieldOffset(8)]
      public RILADDRESS rilAddress = new RILADDRESS ();
      [FieldOffset(536)]
      public RILSUBADDRESS rilSubAddress = new RILSUBADDRESS();
      [FieldOffset(1060)]
      public byte[] sDescription = new byte[256 * 2];
      [FieldOffset(1572)]
      public uint dwValidity;
    }
...
              RILREMOTEPARTYINFO rilRemotePartyInfo = new RILREMOTEPARTYINFO();
              Marshal.PtrToStructure(lpData, rilRemotePartyInfo);
at this point "notsupportedexception" exception is raised.
Testing if i write:
    class RILREMOTEPARTYINFO
    {
      [FieldOffset(0)]
      public uint dwSize;
      [FieldOffset(4)]
      public uint dwParams;
    }
all goes ok, dwSize=1576 (it seams ok, sounds good) and dwParams=5.
But if i add the "RILADDRESS" field type the exception above comes back...
Someone could help me please???



Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  RIL troubles - Giuliano Peretti  07-May-08 11:46:21 AM
View Posts