我无法构建需要 WOW64 Api 的库
我正在修复 32 位应用程序的 Windows Vista 64 位的错误,当我尝试使用函数 Wow64DisableWow64FsRedirection(...) 时,编译器显示“未声明的标识符...”。
我包括 Windows.h 头文件并将 _WIN32_WINNT 设置为 0x0501。
有任何想法吗?
谢谢。
编辑:我们正在使用 MS Visual Studio 2003
I'm fixing a bug with Windows Vista 64 bits of a 32bit application, when I try to use the function Wow64DisableWow64FsRedirection(...) the compiler says 'undeclared identifier...'.
I'm including the Windows.h header file and set _WIN32_WINNT to 0x0501.
Any ideas?
Thanks.
EDIT: We're using MS Visual Studio 2003
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的平台 SDK 文件可能太旧,不具有该功能。 该功能首先出现在XP 64位平台SDK中。 您可以在此处获取最新的 SDK:http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&displaylang=en
尽管它说它是“The Windows SDK for Windows Server® 2008”,它只是最新的 SDK,并且将拥有您需要的所有向后兼容文件。
安装后,根据您的编译器,您可能必须将包含目录指向它。
Your platform SDK files are probably too old to have that function. That function first appeared in the XP 64 bit platform SDK. You can get the latest SDK here: http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&displaylang=en
Even though it says it's "The Windows SDK for Windows Server® 2008" it is just the latest SDK and will have all the backwards compatible files you need.
After you install it, depending on your compiler you'll probably have to point the include directory to it.
你能在头文件中看到这个API吗? 您使用的 Visual Studio 可能没有更新头文件,在这种情况下,您需要为 Kernel32.dll 执行 LoadLibrary,然后为所需函数执行 GetProcAddress。
Can you see this API in the header file? May be the Visual Studio you are using is not having updated header file, in which case you will need to do a LoadLibrary for Kernel32.dll and then GetProcAddress for the required function.
如果您的应用程序需要在 Windows XP 32 位或 Windows 2000 上运行,您应该按照 Canopus 的建议使用
LoadLibrary()
和GetProcAddress()
,因为Wow64DisableWow64FsRedirection( )
和Wow64RevertWow64FsRedirection()
直到 Windows XP 64 位和 Server 2003 SP1 才添加(根据 文档)。If your application needs to work on Windows XP 32-bit or Windows 2000, you should use
LoadLibrary()
andGetProcAddress()
as Canopus suggested, becauseWow64DisableWow64FsRedirection()
andWow64RevertWow64FsRedirection()
were not added until Windows XP 64-bit and Server 2003 SP1 (according to the documentation).