Esempio n. 1
0
    public static void StructWithDefaultNonBlittableFields_IgnoresMarshalAsInfo()
    {
        short s = 41;
        bool  b = true;

        Assert.False(DisabledRuntimeMarshallingNative.GetStructWithShortAndBoolWithVariantBoolCallback()(new StructWithShortAndBool(s, b), s, b));
    }
Esempio n. 2
0
    public static void StructWithDefaultNonBlittableFields_MarshalAsInfo()
    {
        short s = 41;
        bool  b = true;

        var callback = Marshal.GetDelegateForFunctionPointer <CheckStructWithShortAndBoolWithMarshalAsAndVariantBoolCallback>((IntPtr)DisabledRuntimeMarshallingNative.GetStructWithShortAndBoolWithVariantBoolCallback());

        Assert.True(callback(new StructWithShortAndBoolWithMarshalAs(s, b), s, b));
    }