I have a C# struct declared like so:
public struct AdvertisementData { public byte SomeId; [MarshalAs(UnmanagedType.LPArray , SizeConst = 12)] pu
Try to marshal it as ByValArray:
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] public byte[] AnArray;
And also, are you sure that you do not need to set any LayoutKind for your struct?