title: How to marshal wchar[]
body: <p>I've found plenty of information about how to marshal <code>wchar_t</code> and <code>wchar*</code> on the internet, but right now I am trying to marshal the <code>WINBIO_STRING</code> type, which is defined as <code>wchar[256]</code>. Marshalling it as an array of <code>char[]</code> works, but then every other element in the array is <code>\0</code>, and I would like to avoid this. Is there a more proper way to marshal this data (which is a member of a struct, the <code>WINBIO_UNIT_SCHEMA</code> struct in particular). This is my code:</p>
  
  <pre><code>[StructLayout(LayoutKind.Sequential)]
  public struct BiometricUnitSchema
  {
      public int UnitId;
      public BiometricPoolType PoolType;
      public BiometricType BiometricFactor;
      public BiometricSubtype SensorSubType;
      public BiometricCapabilities Capabilities;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
      public char[] DeviceInstanceId;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
      public char[] Description;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
      public char[] Manufacturer;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
      public char[] Model;
      [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
      public char[] SerialNumber;
      public BiometricVersion FirmwareVersion;
  }
  </code></pre>
  
  <p>I also have the problem of the FirmwareVersion field always containing MajorVersion and MinorVersion values of 0, but I am not sure if this result is incorrect or simply misleading.</p>