typedef 解决 dll 包装器问题
我想为 DLL 文件编写一个包装,在本例中是为 python 编写的。问题是参数类型不是 C 标准类型。它们已被类型定义为其他东西。
我有 DLL 文件的头文件...所以我可以手动跟踪参数类型被类型定义的原始标准 C 类型。但想要一种更系统的方法来做到这一点。我想知道是否有一个实用程序可以评估头文件,或者您是否可以在 dll 中的某个位置获取类型定义。
I want to write a wrap for a DLL file, in this case for python. The problem is that the argument types are not the C standard ones. They have been typedef'end to something else.
I have the header files for the DLL files... so I can manually track the original standard C type the argument type was typedef'ined to. But wanted a more systematic way to do this. I was wondering whether there is a utility that would evaluate the header files, or if you can get somewhere in the dll the types definition.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在寻找的工具是 SWIG:
这确实假设您愿意使用 DLL 的标头。如果您想单独使用 DLL,那么您还有更多工作要做。它可能提供一个可用于分析类型的反射接口。如果做不到这一点,您就会陷入痛苦的世界——或者对 DLL 中的任何调试信息进行逆向工程。
I think the tool you are looking for is SWIG:
This does assume that you are willing to use the headers for the DLL. If you want to work solely with the DLL, then you have more work to do. It might provide a reflection interface that you can use to analyze the types. Failing that, you are into a world of pain - or reverse engineering any debugging information in the DLL.