C# UNSAFE Serialization

konnichiwa

LOMCN VIP
VIP
Mar 26, 2003
261
0
132
When i do sizeof() on this class if gives me size 12... i cant seem to fix it, supposed to give me size 48!

[ StructLayout( LayoutKind.Sequential,CharSet=CharSet.Ansi) ]
public struct V3WilFileHeader
{
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst=40)]
public char szName; //[40]
[MarshalAs(System.Runtime.InteropServices.UnmanagedType.I8)]
public long nImageCount;
}

anyone got any ideas?
 
Last edited:

konnichiwa

LOMCN VIP
VIP
Mar 26, 2003
261
0
132
¤]´)÷¤--§îr Äürøñ--¤÷(`[¤ said:
Tried Marshal.SizeOf?

no because its an unmanaged class. it would **** up


(and did because i didnt wanna not test it :P)