使用一个32位程序在64位驱动程序。视窗视窗、驱动程序、程序

2023-09-08 00:44:22 作者:牛b的女人也会下垂。

这只是一个中途编程的问题。首先我有一个PCI-Ex的preSS卡和32/64位驱动程序。目标操作系统必须是一个视窗64位系统。我读了Vista64上下的所有驱动程序都必须认证的64位驱动程序。这是在64位操作系统的一般限制,这是否也适用于XP 64或任何Linux系统?

This is only a half-way programming question. First of all I have a PCI-Express card and 32/64 bit drivers. The target operating system has to be a Windows 64 bit system. I read that under Vista64 all drivers have to be certified 64 bit drivers. Is this a general restriction under 64 bit operating systems and does this also apply to "XP 64" or any Linux system?

因此​​,为了简单起见,假设我用一个64位的驱动程序Vista64上我下的PCIe卡,并有一批64位DLL使用的卡的功能。在另一边有一个大的,传统的32位exe文件,需要使用PCIe设备的程序。该程序转换为64位的将是一个非常巨大的努力。

So for simplicity let's say I use a 64 bit driver for my PCIe card under Vista64 and have a bunch of 64 bit DLLs to use the cards functionality. On the other side there's a large, legacy 32 bit exe program which needs to use the PCIe device. Converting the program to 64 bit would be a really huge effort.

那么,什么可以做,以使该32位程序和64位驱动程序一起?我读到混合32/64位二进制文​​件和dll是不可能的,但在所有这很难相信我。我敢肯定,你可以从一个32位应用程序,打印出Vista64上的正式文件和Windows会以某种方式换这一局面到64位打印机驱动程序。

So what can be done to bring that 32 bit program and the 64 bit driver together? I read that mixing 32/64 bit binaries and DLLs is not possible at all but this is hard to believe for me. I'm sure you can print out a document under Vista64 from within a 32 bit app and Windows will somehow wrap this around to a 64 bit printer driver.

推荐答案

64位时,才需要在Vista下的认证;没有证书颁发机构对于非Windows平台,我不相信认证的XP或Windows Server检查(不确定虽然,这可能取决于你在哪一个Service Pack)。

64-bit certification is only required under Vista; there is no certifying authority for non-Windows platforms, and I don't believe that XP or Windows Server checks for certification (not sure though, and it may depend on which service pack you're on).

如果您是通过Windows API使用的驱动程序,那么就应该是没有问题的; Windows将做32 LT; - > 64位翻译内核。如果你正在尝试加载在你自己的过程中,驱动程序,这可能将是不可能的。正如德克说,你就不得不在屋里自己的进程中运行它,并通过COM服务器进行通信。我不知道是什么箍你必须通过跳跃,如果你要在一个更高的权限执行级别运行的驱动程序,并希望从用户模式进行调用它。

If you're using the driver via the Windows API, then there shouldn't be any problem; Windows will do the 32<->64-bit translations in the kernel. If you're trying to load the driver inside your own process, that probably won't be possible. As Dirk says you'll have to run it inside its own process and communicate through a COM server. I'm not sure what hoops you'll have to jump through if you have to run your driver in a higher-privilege execution level and want to make calls to it from user mode.

希望您的64位DLL提供一个32位的API,或Windows提供了一个标准的驱动器接口(如果它就像一个显示器或网卡常见的I / O设备)。

Hopefully your 64-bit DLLs offer a 32-bit API, or Windows offers a standard driver interface (if it's a common I/O device like a display or network card).