将 Windows 驱动程序转换为 64 位 - 我可以使用 32 位 DLL 吗?
我的 Windows 驱动程序有一个 .sys 文件和一个 .dll (我猜这是驱动程序的编程接口?)。无论如何,我需要编译驱动程序以在 Windows 7 64 位上运行。我已经下载了 DDK 并且能够编译所有内容,但我的应用程序仍然无法运行和新司机一起。
如果应用程序是32位应用程序,驱动程序DLL是否需要编译为32位DLL,而.sys文件为64位文件?或者SYS和DLL文件都需要是64位的吗?
My Windows driver has a .sys file and a .dll (which I'm guessing is the programming interface to the driver?). Anyway, I need to compile the driver to run on Windows 7 64-bit. I have downloaded the DDK and am able to compile everything, but my application still won't work with the new driver.
If the application is a 32-bit application, does the driver DLL need to be compiled as a 32-bit DLL, and the .sys file a 64-bit file? Or do the SYS and DLL files both need to be 64-bit?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 64 位系统上:
如果 DLL 被设计为与设备驱动程序通信,则应仔细编写它以使用与驱动程序相同的数据类型定义。最好驱动程序和 DLL 都避免在用于相互通信的结构中使用针对 32 位和 64 位定义不同的数据类型(例如
size_t
)。但是,这并不意味着 DLL 应该构建为 64 位 DLL(即使用 x86-64 指令集)。它应该使用链接到它的应用程序将使用的任何指令集。
On a 64-bit system:
If a DLL is engineered to communicate with a device driver, it should be carefully written to use the same data type definitions as the driver. It's best if both the driver and the DLL avoid using data types that are defined differently for 32-bit and 64-bit (e.g.
size_t
) in structures that are used for communicating with each other.However, this does not mean that the DLL should be built as a 64-bit DLL (i.e. using the x86-64 instruction set). It should use whatever instruction set the application linking to it will be using.
DLL 也必须是 64 位的。
将尝试查找参考。有一个
这就是为什么 32 位驱动程序无法在 64 位上运行以及它们总是单独下载的原因
The DLL has to be 64 bit too.
Will try to find a reference.Got one
This is why no 32 bit driver works on 64 bit and why they are always separate downloads