protected FixedPointer(Action <IntPtr> recycleHandler) { MemoryType = StructMemoryType.HGlobal; Ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TS))); WindowsInterop.RtlZeroMemory(Ptr, (UIntPtr)T_SIZE); Recycle = recycleHandler; }
protected FixedPointer(IntPtr intptr) //for FromInArg only { MemoryType = StructMemoryType.Native; Ptr = intptr; //Recycle = .. ; //Native data don't need recycle }