Beispiel #1
0
    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));
    }
Beispiel #2
0
    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());
    }
Beispiel #3
0
    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");
    }
Beispiel #4
0
 internal static extern IntPtr Ref(ref CriticalHandleWithNoDefaultCtor handle, HandleCallback handleCallback);
Beispiel #5
0
 internal static extern void Out(IntPtr handleValue, out CriticalHandleWithNoDefaultCtor handle);