protected FixedPointer(Action <IntPtr> recycleHandler) { MemoryType = StructMemoryType.HGlobal; Ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TS))); WindowsInterop.RtlZeroMemory(Ptr, (UIntPtr)T_SIZE); Recycle = recycleHandler; }
public ObjectFromNet() { Ptr = Marshal.AllocHGlobal(T_SIZE); WindowsInterop.RtlZeroMemory(Ptr, (UIntPtr)T_SIZE); WriteDebugMsg("ObjectFromNet New: 0x" + Ptr.ToString("X")); s_map[Ptr] = new WeakReference <ObjectFromNet <TS, TC> >(this, true); cef_base_ref_counted_t *pbrc = (cef_base_ref_counted_t *)Ptr; pbrc->size = T_SIZE; pbrc->add_ref = holder_add_ref; pbrc->release = holder_release; pbrc->has_one_ref = holder_has_one_ref; pbrc->has_at_least_one_ref = holder_has_at_least_one_ref; }
public CefMainArgs() : base(RecyclePtr) { cef_main_args_t *ptr = (cef_main_args_t *)Ptr; ptr->instance = WindowsInterop.GetModuleHandle(null); }