Hi, I have this structure:
4 + 1 + 1 + 8 + 8 +1 = 23 bytesCode:<StructLayout(LayoutKind.Sequential)> Public Structure ContFileHeader Public MagicID As UInteger ' 4 bytes Public MajorVer As Byte ' 1 byte Public MinorVer As Byte ' 1 byte Public Reserved1 As UInt64 ' 8 bytes Public Reserved2 As UInt64 ' 8 bytes Public FTType As Byte ' 1 byte End Structure
Why then:
gives me 32 ?Code:Dim header As New ContFileHeader Debug.WriteLine(Marshal.SizeOf(ContFileHeader))
Is there a way go get 23 as the size of this structure?




Reply With Quote