[Test] public void IppPyrDown_sizeofIppiPyramidTest() { unsafe { var pyr = new IppiPyramid(); //{ // GCHandle handle = GCHandle.Alloc(pyr, GCHandleType.Pinned); // IntPtr pointer = GCHandle.ToIntPtr(handle); // string pointerDisplay = pointer.ToString(); // handle.Free(); // Console.WriteLine(pointerDisplay); //} ulong ptrMain; { TypedReference tr = __makeref(pyr); IntPtr ptr = **(IntPtr**)(&tr); string pointerDisplay = ptr.ToString(); Console.Write("pyr:"); Console.WriteLine(pointerDisplay); ptrMain = (ulong)ptr; } //Console.WriteLine(System.Runtime.InteropServices.Marshal.SizeOf(pyr)); fixed (void* adress = &pyr.pImage) { Console.Write("pImage:"); Console.WriteLine((ulong)adress - ptrMain); } fixed (void* adress = &pyr.pRate) { Console.Write("pRate:"); Console.WriteLine((ulong)adress - ptrMain); } fixed (void* adress = &pyr.pRoi) { Console.Write("pRoi:"); Console.WriteLine((ulong)adress - ptrMain); } fixed (void* adress = &pyr.pState) { Console.Write("pState:"); Console.WriteLine((ulong)adress - ptrMain); } fixed (void* adress = &pyr.pStep) { Console.Write("pStep:"); Console.WriteLine((ulong)adress - ptrMain); } fixed (void* adress = &pyr.level) { Console.Write("level:"); Console.WriteLine((ulong)adress - ptrMain); } } } [StructLayout(LayoutKind.Sequential)] //private struct IppiPyramid // [Added by krt: 09-06-2016] public unsafe class IppiPyramid // [Added by krt: 09-06-2016] { public byte** pImage; public Size* pRoi; public double* pRate; public int* pStep; public byte* pState; public int level; }