我面臨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