Exemple #1
0
 static c000004()
 {
     if (typeof(MulticastDelegate) != null)
     {
         f000003 = Assembly.GetExecutingAssembly().GetModules()[0].ModuleHandle;
     }
 }
 public bool Equals(ModuleHandle handle)
 {
   return default(bool);
 }
 internal unsafe bool IsVisibleFromModule(ModuleHandle module)
 {
     return this._IsVisibleFromModule((IntPtr) module.Value);
 }
Exemple #4
0
 public UniqueMemberToken(int metadataToken, ModuleHandle moduleHandle)
 {
     MetadataToken = metadataToken;
     ModuleHandle = moduleHandle;
 }
Exemple #5
0
 /// <summary>返回由指定元数据标记标识的类型的运行时类型句柄,指定标记所在范围内的类型和方法的泛型类型参数。</summary>
 /// <returns>由 <paramref name="typeToken" /> 标识的类型的 <see cref="T:System.RuntimeTypeHandle" />。</returns>
 /// <param name="typeToken">一个元数据标记,用于标识模块中的一个类型。</param>
 /// <param name="typeInstantiationContext">
 /// <see cref="T:System.RuntimeTypeHandle" /> 结构的数组,表示标记所在范围内的类型的泛型类型参数,如果类型不是泛型,则为 null。</param>
 /// <param name="methodInstantiationContext">
 /// <see cref="T:System.RuntimeTypeHandle" /> 结构对象的数组,表示标记所在范围内的方法的泛型类型参数,如果方法不是泛型,则为 null。</param>
 /// <exception cref="T:System.BadImageFormatException">
 /// <paramref name="typeToken" /> 不是当前模块中类型的有效元数据标记。- 或 -<paramref name="metadataToken" /> 不是当前模块范围内的类型的标记。- 或 -<paramref name="metadataToken" /> 是一个 TypeSpec,它的签名中包含元素类型 var 或 mvar。</exception>
 /// <exception cref="T:System.InvalidOperationException">该方法在空类型句柄上调用。</exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 /// <paramref name="typeToken " />不是有效的标记。</exception>
 public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
 {
     return(new RuntimeTypeHandle(ModuleHandle.ResolveTypeHandleInternal(this.GetRuntimeModule(), typeToken, typeInstantiationContext, methodInstantiationContext)));
 }
Exemple #6
0
 public bool Equals(ModuleHandle handle)
 {
     return((Module)handle.m_ptr == (Module)this.m_ptr);
 }
 public static void RunModuleConstructor(ModuleHandle module) 
 {
    _RunModuleConstructor(module.GetRuntimeModule());
 }
Exemple #8
0
 public bool Equals(ModuleHandle handle)
 {
     return(value == handle.Value);
 }
		public bool Equals(ModuleHandle handle)
		{
			return handle.m_ptr == this.m_ptr;
		}
Exemple #10
0
 public bool Equals(ModuleHandle handle)
 {
     throw new NotImplementedException();
 }
        public static void RunModuleConstructor(ModuleHandle module) 
        {
	        unsafe {
               _RunModuleConstructor(new IntPtr(module.Value));
            }
        }
 public bool Equals(ModuleHandle handle)
 {
     return(default(bool));
 }
        private unsafe void Init(String name, 
                                 MethodAttributes attributes, 
                                 CallingConventions callingConvention, 
                                 Type returnType, 
                                 Type[] signature, 
                                 Type owner, 
                                 Module m, 
                                 bool skipVisibility) {

            DynamicMethod.CheckConsistency(attributes, callingConvention);

            // check and store the signature
            if (signature != null) {
                m_parameterTypes = new RuntimeType[signature.Length];
                for (int i = 0; i < signature.Length; i++) {
                    if (signature[i] == null) 
                        throw new ArgumentException(Environment.GetResourceString("Arg_InvalidTypeInSignature"));
                    m_parameterTypes[i] = signature[i].UnderlyingSystemType as RuntimeType;
                    if (m_parameterTypes[i] == null || m_parameterTypes[i] == typeof(void)) 
                        throw new ArgumentException(Environment.GetResourceString("Arg_InvalidTypeInSignature"));
                }
            }
            else
                m_parameterTypes = new RuntimeType[0];
            
            // check and store the return value
            m_returnType = (returnType == null) ? ((RuntimeType)typeof(void)) : (returnType.UnderlyingSystemType as RuntimeType);
            if (m_returnType == null || m_returnType.IsByRef) 
                throw new NotSupportedException(Environment.GetResourceString("Arg_InvalidTypeInRetType"));

            m_typeOwner = (owner != null) ? owner.UnderlyingSystemType as RuntimeType : null;
            if (m_typeOwner != null) 
                if (m_typeOwner.HasElementType || m_typeOwner.ContainsGenericParameters 
                    || m_typeOwner.IsGenericParameter || m_typeOwner.IsInterface) 
                    throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeForDynamicMethod"));

            m_module = (m != null) ? m.ModuleHandle : m_typeOwner.Module.ModuleHandle;

            // initialize remaining fields
            m_ilGenerator = null;
            m_fInitLocals = true;
            m_method = new RuntimeMethodHandle(null);
            m_skipVisibility  = skipVisibility;

            if (name == null) 
                throw new ArgumentNullException("name");
            m_dynMethod = new RTDynamicMethod(this, name, attributes, callingConvention);
        }
Exemple #14
0
 static ModuleHandle()
 {
     EmptyHandle = new ModuleHandle(null);
 }
Exemple #15
0
 static ModuleHandle()
 {
     EmptyHandle = new ModuleHandle(null);
 }
Exemple #16
0
 internal static bool ContainsPropertyMatchingHash(RuntimeModule module, int propertyToken, uint hash)
 {
     return(ModuleHandle._ContainsPropertyMatchingHash(module.GetNativeHandle(), propertyToken, hash));
 }
Exemple #17
0
 internal static MetadataImport GetMetadataImport(RuntimeModule module)
 {
     return(new MetadataImport(ModuleHandle._GetMetadataImport(module.GetNativeHandle()), module));
 }
 unsafe internal static void GetSecurityAttributes(ModuleHandle module, int token, out object[] securityAttributes)
 {
     _GetSecurityAttributes(module.Value, token, out securityAttributes);
 }
Exemple #19
0
 public bool Equals(ModuleHandle handle)
 {
     return(handle._ptr == _ptr);
 }
 public static void RunModuleConstructor(ModuleHandle module)
 {
 }
 internal bool IsVisibleFromModule(ModuleHandle module)
 {
     return _IsVisibleFromModule((IntPtr)module.Value);
 }
 static QBModifiedCheck()
 {
     QBModifiedCheck.char_0 = new char[]
     {
         '\u0001',
         '\u0002',
         '\u0003',
         '\u0004',
         '\u0005',
         '\u0006',
         '\a',
         '\b',
         '\u000e',
         '\u000f',
         '\u0010',
         '\u0011',
         '\u0012',
         '\u0013',
         '\u0014',
         '\u0015',
         '\u0016',
         '\u0017',
         '\u0018',
         '\u0019',
         '\u001a',
         '\u001b',
         '\u001c',
         '\u001d',
         '\u001e',
         '\u001f',
         '\u007f',
         '\u0080',
         '\u0081',
         '\u0082',
         '\u0083',
         '\u0084',
         '\u0086',
         '\u0087',
         '\u0088',
         '\u0089',
         '\u008a',
         '\u008b',
         '\u008c',
         '\u008d',
         '\u008e',
         '\u008f',
         '\u0090',
         '\u0091',
         '\u0092',
         '\u0093',
         '\u0094',
         '\u0095',
         '\u0096',
         '\u0097',
         '\u0098',
         '\u0099',
         '\u009a',
         '\u009b',
         '\u009c',
         '\u009d',
         '\u009e',
         '\u009f'
     };
     Type typeFromHandle = typeof(MulticastDelegate);
     if (typeFromHandle != null)
     {
         QBModifiedCheck.moduleHandle_0 = Assembly.GetExecutingAssembly().GetModules()[0].ModuleHandle;
     }
 }
Exemple #23
0
 /// <summary>返回由指定元数据标记标识的类型的运行时类型句柄。</summary>
 /// <returns>由 <paramref name="typeToken" /> 标识的类型的 <see cref="T:System.RuntimeTypeHandle" />。</returns>
 /// <param name="typeToken">一个元数据标记,用于标识模块中的一个类型。</param>
 /// <exception cref="T:System.BadImageFormatException">
 /// <paramref name="typeToken" /> 不是当前模块中类型的有效元数据标记。- 或 -<paramref name="metadataToken" /> 不是当前模块范围内的类型的标记。- 或 -<paramref name="metadataToken" /> 是一个 TypeSpec,它的签名中包含元素类型 var 或 mvar。</exception>
 /// <exception cref="T:System.InvalidOperationException">该方法在空类型句柄上调用。</exception>
 /// <filterpriority>1</filterpriority>
 public RuntimeTypeHandle ResolveTypeHandle(int typeToken)
 {
     return(new RuntimeTypeHandle(ModuleHandle.ResolveTypeHandleInternal(this.GetRuntimeModule(), typeToken, (RuntimeTypeHandle[])null, (RuntimeTypeHandle[])null)));
 }
Exemple #24
0
 static ModuleHandle()
 {
     EmptyHandle = GetEmptyMH();
 }
Exemple #25
0
 internal static IRuntimeMethodInfo ResolveMethodHandleInternal(RuntimeModule module, int methodToken)
 {
     return(ModuleHandle.ResolveMethodHandleInternal(module, methodToken, (RuntimeTypeHandle[])null, (RuntimeTypeHandle[])null));
 }
Exemple #26
0
 internal unsafe bool IsVisibleFromModule(ModuleHandle module)
 {
     return(this._IsVisibleFromModule((IntPtr)module.Value));
 }
	public void SetUp () {
		module = typeof (ModuleHandleTest).Assembly.GetModules ()[0].ModuleHandle;
	}
Exemple #28
0
 /// <summary>Returns a runtime handle for the field identified by the specified metadata token.</summary>
 /// <param name="fieldToken">A metadata token that identifies a field in the module.</param>
 /// <returns>A <see cref="T:System.RuntimeFieldHandle" /> for the field identified by <paramref name="fieldToken" />.</returns>
 /// <exception cref="T:System.BadImageFormatException">
 ///         <paramref name="metadataToken" /> is not a valid token in the scope of the current module.-or-
 ///         <paramref name="metadataToken" /> is not a token for a field in the scope of the current module.-or-
 ///         <paramref name="metadataToken" /> identifies a field whose parent <see langword="TypeSpec" /> has a signature containing element type <see langword="var" /> or <see langword="mvar" />.</exception>
 /// <exception cref="T:System.InvalidOperationException">The method is called on an empty field handle.</exception>
 // Token: 0x060012C1 RID: 4801 RVA: 0x00037CC1 File Offset: 0x00035EC1
 public RuntimeFieldHandle ResolveFieldHandle(int fieldToken)
 {
     return(new RuntimeFieldHandle(ModuleHandle.ResolveFieldHandleInternal(this.GetRuntimeModule(), fieldToken, null, null)));
 }
Exemple #29
0
 public unsafe bool Equals(ModuleHandle handle)
 {
     return handle.m_ptr == m_ptr;
 }
Exemple #30
0
		public bool Equals (ModuleHandle handle)
		{
			return value == handle.Value;
		}