Пример #1
0
        public static object FromAbi(IntPtr ptr)
        {
            if (ptr == IntPtr.Zero)
            {
                return(null);
            }
            var vftblT  = new Vftbl(ptr);
            var wrapper = new Nullable <T>(ObjectReference <Vftbl> .FromAbi(ptr, vftblT.IInspectableVftbl.IUnknownVftbl, vftblT));

            return(wrapper.Value);
        }
Пример #2
0
            static unsafe Vftbl()
            {
                AbiToProjectionVftable = new Vftbl
                {
                    IInspectableVftbl = global::WinRT.IInspectable.Vftbl.AbiToProjectionVftable,
                    Close_0           = Do_Abi_Close_0
                };
                var nativeVftbl = (IntPtr *)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf <global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1);

                Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false);
                AbiToProjectionVftablePtr = (IntPtr)nativeVftbl;
            }