[StructLayout(LayoutKind.Sequential)] struct Foo { public ushort W; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] public byte[] X; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public Inner[] data; }