SetupDiCallClassInstaller throws ERROR_IN_WOW64 when compiled for 32 bit on a 64 bit machine.

放肆的年华 提交于 2019-12-29 08:59:08

问题


Calling SetupDiCallClassInstaller on a 64 bit machine when compiled for 32 bit returns false.

GetLastError() == ERROR_IN_WOW64

All the other function calls work fine under 32bit, just this one is giving me problems.

I'm wondering if anyone knows what I am doing wrong here.


回答1:


As Hans Passant pointed as a comment to the question, you cannot call that function from a 32-bit process on a 64-bit Windows platform. When you try to do so anyway, you get an ERROR_IN_WOW64. The reason why you can't do this is that your 32-bit process invokes the 32-bit version of the API. On a 64-bit platform, this API is running in the WoW64 windows subsystem (https://en.wikipedia.org/wiki/WoW64). Some methods like SetupDiCallClassInstaller are not available within this subsystem. When you try to invoke them, an ERROR_IN_WOW64 occurs. The application should invoke the 64-bit version of the API directly instead. One way to achieve this is to recompile your application targetting the 64-bit platform.



来源:https://stackoverflow.com/questions/8684061/setupdicallclassinstaller-throws-error-in-wow64-when-compiled-for-32-bit-on-a-64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!