Beispiel #1
0
        internal static IRuntimeMethodInfo ResolveMethodHandleInternal(RuntimeModule module, int methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
        {
            int typeInstCount;

            IntPtr[] typeInstantiationContext2 = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out typeInstCount);
            int      methodInstCount;

            IntPtr[] methodInstantiationContext2 = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, out methodInstCount);
            RuntimeMethodHandleInternal runtimeMethodHandleInternal = ModuleHandle.ResolveMethodHandleInternalCore(module, methodToken, typeInstantiationContext2, typeInstCount, methodInstantiationContext2, methodInstCount);
            IRuntimeMethodInfo          result = new RuntimeMethodInfoStub(runtimeMethodHandleInternal, RuntimeMethodHandle.GetLoaderAllocator(runtimeMethodHandleInternal));

            GC.KeepAlive(typeInstantiationContext);
            GC.KeepAlive(methodInstantiationContext);
            return(result);
        }
Beispiel #2
0
        internal static IRuntimeMethodInfo ResolveMethodHandleInternal(RuntimeModule module, int methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
        {
            int length1;

            IntPtr[] typeInstantiationContext1 = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out length1);
            int      length2;

            IntPtr[] methodInstantiationContext1              = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, out length2);
            RuntimeMethodHandleInternal methodHandleInternal  = ModuleHandle.ResolveMethodHandleInternalCore(module, methodToken, typeInstantiationContext1, length1, methodInstantiationContext1, length2);
            RuntimeMethodInfoStub       runtimeMethodInfoStub = new RuntimeMethodInfoStub(methodHandleInternal, (object)RuntimeMethodHandle.GetLoaderAllocator(methodHandleInternal));

            GC.KeepAlive((object)typeInstantiationContext);
            GC.KeepAlive((object)methodInstantiationContext);
            return((IRuntimeMethodInfo)runtimeMethodInfoStub);
        }
Beispiel #3
0
        internal static IRuntimeMethodInfo ResolveMethodHandleInternal(RuntimeModule module, int methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
        {
            int num;
            int num2;

            IntPtr[] ptrArray  = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out num);
            IntPtr[] ptrArray2 = RuntimeTypeHandle.CopyRuntimeTypeHandles(methodInstantiationContext, out num2);
            RuntimeMethodHandleInternal methodHandleValue = ResolveMethodHandleInternalCore(module, methodToken, ptrArray, num, ptrArray2, num2);
            IRuntimeMethodInfo          info = new RuntimeMethodInfoStub(methodHandleValue, RuntimeMethodHandle.GetLoaderAllocator(methodHandleValue));

            GC.KeepAlive(typeInstantiationContext);
            GC.KeepAlive(methodInstantiationContext);
            return(info);
        }