title: converting c struct to c# from dll
body: <p>I am using a dll that was written in c.  I have imported all the functions i need into my c# program.  Most of the functions i can get to work properly but am having trouble with a few. The functions i am having issues with require a struct as input.  I assume i need to define this struct in C#, which i have done but I am starting to confuse myself so I will leave what i have attempted out.  The struct is fairly long so i will simply what it looks like in c:</p>
  
  <pre><code>typedef struct chain_link_info
  {
    unsigned short command;
    unsigned long* buff_id;
    FLAGS_TYPES    flags;  // this is a union that i will list below
  } CHAIN_LINK_INFO;
  
  typedef union flags_type
  {
    unsigned long ulong;
  
    struct
    {
      unsigned short std_flags;
      unsigned short high
    } ushort;
  
    struct
    {
      unsigned int a : 1;
      unsinged int b : 1;
      unsinged int c : 1;
      unsinged int d : 1;
      unsinged int e : 2;
      unsinged int f : 1;
      unsinged int g : 1;
      unsinged int h : 1;
      unsinged int i : 1;
      unsinged int j : 1;
      unsinged int k : 1;
      unsinged int l : 1;
      unsinged int m : 1;
      unsinged int n : 1;
      unsinged int o : 1;
      unsigned int high_word :16
    } std_bits;
  } FLAGS_TYPE;
  </code></pre>
  
  <p>what is the proper way to define these stucts in C#?  Thank you</p>