Example #1
0
        public override int GetContainingTypeLib(IntPtr ppTLB, IntPtr pIndex)
        {
            // even though pIndex is described as a non-optional OUT argument, mscorlib sometimes calls this with a nullptr from the C++ side.
            if (pIndex == IntPtr.Zero)
            {
                RdMarshal.WriteIntPtr(ppTLB, IntPtr.Zero);
                return((int)KnownComHResults.E_INVALIDARG);
            }

            RdMarshal.WriteIntPtr(ppTLB, RdMarshal.GetComInterfaceForObject(_container, typeof(ITypeLibInternal)));
            if (pIndex != IntPtr.Zero)
            {
                RdMarshal.WriteInt32(pIndex, ContainerIndex);
            }

            return((int)KnownComHResults.S_OK);
        }
 public IntPtr GetCOMReferencePtr()
 => RdMarshal.GetComInterfaceForObject(this, typeof(ITypeLibInternal));