开发者

Converting Windows driver to 64 bit - can I use a 32-bit DLL?

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 t开发者_JAVA百科o be 64-bit?


On a 64-bit system:

  • driver should always be 64-bit
  • an application can be either 32-bit or 64-bit
  • a DLL used by an application (that is, a DLL an application links with) should be 32-bit for a 32-bit application and 64-bit for a 64-bit application

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.


The DLL has to be 64 bit too.

Will try to find a reference.

Got one

Since a 64-bit program can't call a 32-bit Dynamic Link Library (DLL)

This is why no 32 bit driver works on 64 bit and why they are always separate downloads

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜