I have a struct that is defined with Pack=1 and it is 29 bytes long. If it is not packed, it would be 32 bytes long.
Marshal.SizeOf(TypeOf(StructName)) returns 29.
StructName struct; sizeof(struct) returns 32.
When I write that struct out using MemoryMappedViewAccessor it writes out 32 bytes, NOT 29 bytes.
So, short of marshalling the struct to a byte array and writing it out that way, is there any way to get it to write out that struct correctly?
More …