是否有可能链接标有MethodImplOptions.InternalCall其实施的方法? [英] Is it possible to link a method marked with MethodImplOptions.InternalCall to its implementation?

查看:1117
本文介绍了是否有可能链接标有MethodImplOptions.InternalCall其实施的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在试图找到一个异常的可能原因,我下面使用反射一个code路径。我有越陷越深,但最终在方法调用,看起来像:

In trying to find the possible cause of an exception, I'm following a code path using Reflector. I've got deeper and deeper, but ended up at a method call that looks like:

[MethodImpl(MethodImplOptions.InternalCall)]
private extern void SomeMethod(int someParameter);

此标记的方法告诉框架的地方调用C ++函数。有没有办法找出什么方法实际上被调用,反过来还有什么可能被称为?

This markup on the method tells the framework to call a C++ function somewhere. Is there any way to find out what method actually gets called, and in turn what else is likely to be called?

<子>注:我真的不希望看到这种方法的来源$ C ​​$ C,我只是想知道,可以抛出异常,我看到的起源出这个方法调用的可能的事情。

推荐答案

内部呼叫最终使呼叫在CLR C ++函数。你可以找到他们早在<一个href="http://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&displaylang=en"相对=nofollow>转子源$ C ​​$ C 。看看CLR的\ src \虚拟机\ ecall.cpp找到从.NET可视名称为CLR函数名的映射。当心是越来越过时的源。

Internal calls end up making a call to a C++ function in the CLR. You can find them back in the Rotor source code. Look at clr\src\vm\ecall.cpp to find the mapping from the .NET visible name to the CLR function name. Beware that the source is getting dated.

这篇关于是否有可能链接标有MethodImplOptions.InternalCall其实施的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆