private ResolveType ( int typeToken, |
||
typeToken | int | |
typeInstArgs | ||
typeInstCount | int | |
methodInstArgs | ||
methodInstCount | int | |
return |
internal static unsafe RuntimeType ResolveTypeHandleInternal(RuntimeModule module, int typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) { ModuleHandle.ValidateModulePointer(module); if (!ModuleHandle.GetMetadataImport(module).IsValidToken(typeToken)) { throw new ArgumentOutOfRangeException("metadataToken", Environment.GetResourceString("Argument_InvalidToken", (object)typeToken, (object)new ModuleHandle(module))); } int length1; IntPtr[] numArray1 = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out length1); int length2; IntPtr[] numArray2 = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, out length2); IntPtr[] numArray3 = numArray1; // ISSUE: cast to a reference type // ISSUE: explicit reference operation // ISSUE: explicit reference operation fixed(IntPtr *typeInstArgs = & ^ (numArray1 == null || numArray3.Length == 0 ? (IntPtr&)IntPtr.Zero : @numArray3[0])) fixed(IntPtr * methodInstArgs = numArray2) { RuntimeType o = (RuntimeType)null; ModuleHandle.ResolveType(module, typeToken, typeInstArgs, length1, methodInstArgs, length2, JitHelpers.GetObjectHandleOnStack <RuntimeType>(ref o)); GC.KeepAlive((object)typeInstantiationContext); GC.KeepAlive((object)methodInstantiationContext); return(o); } }
internal unsafe static RuntimeType ResolveTypeHandleInternal(RuntimeModule module, int typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) { ModuleHandle.ValidateModulePointer(module); if (!ModuleHandle.GetMetadataImport(module).IsValidToken(typeToken)) { throw new ArgumentOutOfRangeException("metadataToken", Environment.GetResourceString("Argument_InvalidToken", new object[] { typeToken, new ModuleHandle(module) })); } int typeInstCount; IntPtr[] array = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out typeInstCount); int methodInstCount; IntPtr[] array2 = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, out methodInstCount); fixed(IntPtr *ptr = array) { fixed(IntPtr *ptr2 = array2) { RuntimeType result = null; ModuleHandle.ResolveType(module, typeToken, ptr, typeInstCount, ptr2, methodInstCount, JitHelpers.GetObjectHandleOnStack <RuntimeType>(ref result)); GC.KeepAlive(typeInstantiationContext); GC.KeepAlive(methodInstantiationContext); return(result); } } }