获取 Win32 Dll 中的类型

发布于 2024-09-04 20:44:09 字数 212 浏览 11 评论 0原文

我想在普通的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光暖心i 2024-09-11 20:44:09

首先尝试 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文