示例#1
0
        public TYPEDESC CreateTypeDesc(IntPtr finalTypeHRef, MockUnmanagedMemoryHelper memoryHelper)
        {
            TYPEDESC typeDesc;

            typeDesc.vt      = (short)VarEnum.VT_USERDEFINED;
            typeDesc.lpValue = finalTypeHRef;
            return(typeDesc);
        }
示例#2
0
        /// <summary>
        /// Public constructor
        /// </summary>
        public MockTypeLib()
        {
            _containedTypeInfos     = new List <MockTypeInfo>();
            _typeLibAttributes.guid = Guid.NewGuid();
            _exportedFromComPlus    = null;

            _memoryHelper  = new MockUnmanagedMemoryHelper();
            _faultInjector = new MockFaultInjectionHelper <MockTypeLibrariesFailurePoints>();
        }
示例#3
0
        public TYPEDESC CreateTypeDesc(IntPtr finalTypeHRef, MockUnmanagedMemoryHelper memoryHelper)
        {
            TYPEDESC typeDesc;

            typeDesc.vt      = (short)VarEnum.VT_PTR;
            typeDesc.lpValue = memoryHelper.AllocateHandle(Marshal.SizeOf <TYPEDESC>());
            Marshal.StructureToPtr(_baseElementType.CreateTypeDesc(finalTypeHRef, memoryHelper), typeDesc.lpValue, false);
            return(typeDesc);
        }
示例#4
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public MockTypeInfo()
        {
            _implementedTypes = new List <MockTypeInfo>();
            _definedVariables = new List <ICompositeTypeInfo>();
            _definedFunctions = new List <FuncInfo>();

            _memoryHelper = new MockUnmanagedMemoryHelper();

            // each type has a unique guid
            _typeAttributes.guid = Guid.NewGuid();

            // default typekind value is TKIND_ENUM so just pick something else that doesn't have a special meaning in the code
            // (we skip enum type infos)
            _typeAttributes.typekind = TYPEKIND.TKIND_INTERFACE;
        }