tags:

views:

290

answers:

1

The question is basically a follow up to this thread: http://stackoverflow.com/questions/602587/using-a-64-bit-driver-in-a-32-bit-program-windows

As I learned when I have a 64 bit driver, which is used over a set of 64 bit DLLs I cannot have a 32 bit process calling the DLLs. We now use some funny interpocess communication to workaround this.

What's unclear is how an automatic 64<->32 bit translation happens when using a "standard device" like a graphics card. Any 32 bit application under a Windows 64 Bit OS should be able to use a printer driver or draw something with GDI by using some Windows DLLs. Somehwere Microsoft has to make a translation from 32 bit to the 64 bit hardware driver for the graphics card or printer. I know that WoW64 does that for registry and file system access but does it also translate to standard drivers?

The specific question is if we had a 64 bit WDM driver for the hardware, could this be easily used by a 32 bit application, with Windows doing the translation 64<->32?

+2  A: 

"Standard devices" are considered "standard" because Windows themselves takes responsibility for them. In the case of 64-bits Windows, that means there are both 64 bits and 32 bits DLLs. The 32 bit DLLs are special, and can talk to the 64 bits kernel (including drivers in that kernel). In general, the 32 bits DLLs do not talk to 64 bits DLLs, as there is no 64 bits process in which the latter DLLs could be loaded.

MSalters
So it could work if the WDM driver features both a 64 and 32 bit interface (DLL)?
asdrubael
A WDM driver by definition is not a DLL. Also, a WDM driver runs in kernel mode, whereas DLLs run in a user-mode process. There might be companion DLLs to the WDM driver, but that would not be expected for standard devices.
MSalters
Ok I tested the whole thing by using a 64 bit WDM driver with a 32 bit application and it worked straight away.
asdrubael