Example #1
0
        public static object FromAbi(IntPtr ptr)
        {
            if (ptr == IntPtr.Zero)
            {
                return(null);
            }
            var vftblT  = new Vftbl(ptr);
            var wrapper = new IReferenceArray <T>(ObjectReference <Vftbl> .FromAbi(ptr, vftblT));

            return(wrapper.Value);
        }
Example #2
0
        static unsafe BoxedArrayIReferenceArrayImpl()
        {
            AbiToProjectionVftable = new IReferenceArray <T> .Vftbl
            {
                IInspectableVftbl = global::WinRT.IInspectable.Vftbl.AbiToProjectionVftable,
                get_Value_0       = Do_Abi_get_Value_0
            };
            var nativeVftbl = (IntPtr *)ComWrappersSupport.AllocateVtableMemory(typeof(BoxedArrayIReferenceArrayImpl <T>), Marshal.SizeOf <global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1);

            Marshal.StructureToPtr(AbiToProjectionVftable.IInspectableVftbl, (IntPtr)nativeVftbl, false);
            nativeVftbl[6] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.get_Value_0);

            AbiToProjectionVftablePtr = (IntPtr)nativeVftbl;
        }