diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:53 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:05:53 +0200 |
commit | 618dfb51d93898632830f1b87443d3f748780871 (patch) | |
tree | bac520a2e261154f8d35b0cb8aa345f5ab373811 /shared/shadow.cpp | |
parent | 3.4 (diff) | |
download | FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.tar.gz FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.tar.bz2 FreeFileSync-618dfb51d93898632830f1b87443d3f748780871.zip |
3.5
Diffstat (limited to 'shared/shadow.cpp')
-rw-r--r-- | shared/shadow.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/shared/shadow.cpp b/shared/shadow.cpp index fd99da16..be0f7c85 100644 --- a/shared/shadow.cpp +++ b/shared/shadow.cpp @@ -34,13 +34,15 @@ bool newerThanXP() bool runningWOW64() //test if process is running under WOW64 (reference http://msdn.microsoft.com/en-us/library/ms684139(VS.85).aspx) { + //dynamically load windows API function typedef BOOL (WINAPI *IsWow64ProcessFunc)( HANDLE hProcess, PBOOL Wow64Process); - const IsWow64ProcessFunc isWow64Process = reinterpret_cast<IsWow64ProcessFunc>( - ::GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process")); - if (isWow64Process != NULL) + static const IsWow64ProcessFunc isWow64Process = + Utility::loadDllFunction<IsWow64ProcessFunc>(L"kernel32.dll", "IsWow64Process"); + + if (isWow64Process) { BOOL isWow64 = FALSE; if ((*isWow64Process)(::GetCurrentProcess(), &isWow64)) @@ -59,13 +61,13 @@ const wxString& getShadowDllName() */ static const wxString filename( - Utility::is64BitBuild ? - (newerThanXP() ? + newerThanXP() ? + (Utility::is64BitBuild ? wxT("Shadow_Server2003_x64.dll") : - wxT("Shadow_XP_x64.dll")) : + wxT("Shadow_Server2003_Win32.dll")) : - (newerThanXP() ? - wxT("Shadow_Server2003_Win32.dll") : + (Utility::is64BitBuild ? + wxT("Shadow_XP_x64.dll") : wxT("Shadow_XP_Win32.dll"))); assert_static(Utility::is32BitBuild || Utility::is64BitBuild); |