获取 Win32 Dll 中的类型
我想在普通的 Win32.dll 中获取类型和详细信息,就像在 COM 中一样。在 COM 中,嵌入 idl 中的所有内容都会生成 TLB,MSFT 公开 APIS,我们可以在其中提取类型。
我需要 Win32 中定义的类型以及该类型的所有详细信息(例如成员及其类型)。解析 PE 文件并查找导出表仅给出导出函数,我希望在其中定义所有自定义类型(Win32 接口、类和带有类型的成员详细信息)。
I want to get the types and details in a plain Win32.dll just like we can in a COM. In COM, everything embed inside idl results in TLB, MSFT exposes APIS in which we can extract types.
I need the types defined in the Win32 and all of the details on that type (e.g. members and its types). Parsing a PE file and looking up exported tables only gives the exported functions, I want all custom types (Win32 interfaces, classes and member details with types) defined in it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先尝试 pinvoke.net 是否具有相关 Win32 API 的定义。如果是这样,请复制并添加粘贴到您的源代码。如果不可用,您可以使用现有的定义和 MSDN 文档以及 SDK 头文件来手工制作正确的方法签名和数据结构。
另一种选择是引入 C++ CLI ,它可以创建混合本机 - CLR 汇编。 CLI 项目可以像本机 C++ 项目一样使用 Win32 API,并为其他程序集显示更高级别的 .Net 接口。
Try first whether pinvoke.net has the definitions for Win32 API in question. If so, copy & paste to your source code. If not available, you can use the existing defitions and MSDN documentation and SDK header files to hand-craft the correct method signatures and data structures.
Another option is to introduce C++ CLI that can create a mixed native-CLR asembly. The CLI project can use the Win32 API just like a native C++ project and reveal a higher level .Net interface for your other assemblies.