public static void Ref() { IntPtr handleValue = new IntPtr(5); CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue); //TODO: Expected MissingMemberException but throws MissingMethodException Assert.Throws <MissingMethodException>(() => Native.Ref(ref handle, null)); }
public static void InRef() { IntPtr handleValue = new IntPtr(4); AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue); Native.InRef(ref handle, null); Assert.Equal(handleValue.ToInt32(), handle.Handle.ToInt32()); }
public static void In() { IntPtr handleValue = new IntPtr(1); CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue); IntPtr value; value = Native.In(handle, null); Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value"); }
internal static extern IntPtr Ref(ref CriticalHandleWithNoDefaultCtor handle, HandleCallback handleCallback);
internal static extern void Out(IntPtr handleValue, out CriticalHandleWithNoDefaultCtor handle);