resolve IsWow64Process() dynamically; don't rely on its declaration being present in the headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1162,19 +1162,27 @@ wxString wxGetOsDescription()
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// taken from http://blogs.msdn.com/oldnewthing/archive/2005/02/01/364563.aspx
|
|
||||||
bool wxIsPlatform64Bit()
|
bool wxIsPlatform64Bit()
|
||||||
{
|
{
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
return true; // 64-bit programs run only on Win64
|
return true; // 64-bit programs run only on Win64
|
||||||
#elif defined(_WIN32)
|
#else // Win32
|
||||||
// 32-bit programs run on both 32-bit and 64-bit Windows
|
// 32-bit programs run on both 32-bit and 64-bit Windows so check
|
||||||
// so must sniff
|
typedef BOOL (WINAPI *IsWow64Process_t)(HANDLE, BOOL *);
|
||||||
BOOL f64 = FALSE;
|
|
||||||
return IsWow64Process(GetCurrentProcess(), &f64) && f64;
|
wxDynamicLibrary dllKernel32(_T("kernel32.dll"));
|
||||||
#else
|
IsWow64Process_t *pfnIsWow64Process =
|
||||||
return false; // Win64 does not support Win16
|
(IsWow64Process_t *)dllKernel32.RawGetSymbol(_T("IsWow64Process"));
|
||||||
#endif
|
|
||||||
|
BOOL wow64 = FALSE;
|
||||||
|
if ( pfnIsWow64Process )
|
||||||
|
{
|
||||||
|
(*pfnIsWow64Process)(::GetCurrentProcess(), &wow64);
|
||||||
|
}
|
||||||
|
//else: running under a system without Win64 support
|
||||||
|
|
||||||
|
return wow64 != FALSE;
|
||||||
|
#endif // Win64/Win32
|
||||||
}
|
}
|
||||||
|
|
||||||
wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
|
wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
|
||||||
|
Reference in New Issue
Block a user