Esempio n. 1
0
        public void GetLibAttr(out IntPtr ppTLibAttr)
        {
            // Fail BEFORE allocating the handle to avoid leaks. If the real COM object fails in this method
            // and doesn't return the handle or clean it up itself there's not much we can do to avoid the leak.
            _faultInjector.FailurePointThrow(MockTypeLibrariesFailurePoints.ITypeLib_GetLibAttr);

            ppTLibAttr = _memoryHelper.AllocateHandle(Marshal.SizeOf(typeof(TYPELIBATTR)));
            Marshal.StructureToPtr(this.Attributes, ppTLibAttr, false);
        }
Esempio n. 2
0
        void IFixedTypeInfo.GetRefTypeOfImplType(int index, out System.IntPtr href)
        {
            Assert.True(index >= 0 && index < _typeAttributes.cImplTypes);

            _faultInjector.FailurePointThrow(MockTypeLibrariesFailurePoints.ITypeInfo_GetRefTypeOfImplType);

            href = ((System.IntPtr)index + s_HREF_IMPLTYPES_OFFSET);
        }