为什么SetupDiCallClassInstaller功能仅限于64位程序? [英] Why is the SetupDiCallClassInstaller function restricted to 64 bit programs?
问题描述
试图从在32位模式编译的程序调用SetupDiCallClassInstaller无法在64位Windows。
Attempting to call SetupDiCallClassInstaller from a program compiled in 32 bit mode fails on 64 bit Windows.
显然,这是由设计,但我想知道原因。
Apparently this is by design, but I'd like to know the reason.
推荐答案
根据MSDN:
设备安装的:
32位版本的应用程序必须检查由UpdateDriverForPlugAndPlayDevices返回的值。如果返回值是ERROR_IN_WOW64,32位应用程序执行在64位平台上,并不能更新内置驱动程序。相反,它必须调用CreateProcess的(在Windows SDK文档中所述),启动64位版本的应用程序。然后,64位版本可以调用UpdateDriverForPlugAndPlayDevices,指定标识的64位版本的所有文件的位置FullInfPath参数。
The 32-bit version of the application must check the value returned by UpdateDriverForPlugAndPlayDevices. If the return value is ERROR_IN_WOW64, the 32-bit application is executing on a 64-bit platform and cannot update inbox drivers. Instead, it must call CreateProcess (described in the Windows SDK documentation) to start the 64-bit version of the application. The 64-bit version can then call UpdateDriverForPlugAndPlayDevices, specifying a FullInfPath parameter that identifies the location of the 64-bit versions of all files.
因此,它看起来就像是被设计来报告 ERROR_IN_WOW64
特别希望不要在WOW64工作的任何API,一个32位进程调用64位程序调用API
So it looks like any API that is designed to report ERROR_IN_WOW64
is specifically intended NOT to work in WOW64, a 32bit process has to invoke a 64bit process to call the API.
这篇关于为什么SetupDiCallClassInstaller功能仅限于64位程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!