// callback wrappers public static IObjectBase _IP2Obj(IntPtr varobj, bool freehandle = false) { IntPtr handleP = Marshal.ReadIntPtr(varobj, NI.VarObj.offsetOfData); IObjectBase obj = (IObjectBase)HDL.GetObj(handleP); if (freehandle) { HDL.Free(handleP); } return(obj); }
public void DisownClassObject() { if (_sgsObject == IntPtr.Zero) { throw new SGSException(RC.EINPROC, "FreeClassObject - object is not allocated"); } Marshal.WriteIntPtr(_sgsObject, NI.VarObj.offsetOfIface, _sgsNullObjectInterface); HDL.Free(Marshal.ReadIntPtr(_sgsObject, NI.VarObj.offsetOfData)); Marshal.WriteIntPtr(_sgsObject, NI.VarObj.offsetOfData, IntPtr.Zero); FreeClassObject(); }