为什么SetupDiCallClassInstaller函数仅限于64位程序?
尝试从以 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 MSDN:
64 位系统上的设备安装 :
因此,看起来任何旨在报告
ERROR_IN_WOW64
的API都专门不适用于WOW64,32位进程必须调用64位进程才能调用该API。According to MSDN:
Device Installations on 64-Bit Systems:
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.如果您从 64 位操作系统上的 32 位进程进行该调用,则会失败,因为它必须修改注册表的 64 位部分中的某些注册表项。如果您要从 64 位操作系统上的 64 位进程进行该调用,那么在 32 位操作系统上使用 32 位进程同样会成功。
If you are making that call from a 32bit process on a 64bit OS, it fails because it has to modify some registry keys in the 64bit portion of the registry. Where else if you were to make that call from a 64bit process on a 64bit OS, it would succeed likewise with 32bit process on a 32bit OS.