diff options
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); |