我面临Wow64DisableWow64FsRedirection()
的问题。当在Windows 10中的Visual Studio中为64位编译时,Wow64DisableWow64FsRedirection()函数无法正常工作
当我编译在Visual Studio 2010在64位平台上,它不是在窗口10个,这与错误1.
返回但是,当我编译为32位平台相反,在窗口10
typedef BOOL(__stdcall *tFSRED)(HMODULE);
HMODULE hKernel = LoadLibrary(_T("Kernel32.dll")); // Get Kernel module handle
if (hKernel == NULL)
{
return 2;
}
tFSRED pFunc;
pFunc = (tFSRED) GetProcAddress(hKernel, "Wow64DisableWow64FsRedirection");
ret = pFunc(&oldValue); // Turn the file the file system redirector off
if (ret == FALSE)
{
_tprintf(_T("\nFile System Redirection could not be turned off. Reason: %d"), GetLastError());
return 4;
}
// ret is always TRUE when compile through 32-bit platform
// but ret return FALSE when compile through 64-bit platform
函数工作在Visual Studio中,如果我编译为64位平台,那么如果我在depends.exe
打开生成EXE编译后,它显示64在EXE的前面。
选择32位平台后,生成的EXE是32位。这个EXE适用于我的情况,但我希望我的EXE是64位的,所以我选择了64位平台,并且我得到了一个64位的EXE,但它并不像我上面所解释的那样工作。
将代码包含在问题主体中,以便您可以将代码格式正确地编码为代码。 – zett42