diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2010-12-01 16:39:28 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2010-12-01 16:39:28 +0000 |
commit | 9e5dc7e4066c92cad4229bb4356411874bd1fe21 (patch) | |
tree | d1c62319006e46833b49f58d35b66f2548642012 /version_info.c | |
parent | 9e3a12e9f023e9fc477c3ec719801452c4b4740d (diff) |
Fix bug #5453 "Help->About Wireshark mis-reports OS" (again) without the help of MSDN code fragments.
svn path=/trunk/; revision=35090
Diffstat (limited to 'version_info.c')
-rw-r--r-- | version_info.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/version_info.c b/version_info.c index 32f99fca4e..68b6a1c369 100644 --- a/version_info.c +++ b/version_info.c @@ -180,6 +180,10 @@ get_compiled_version_info(GString *str, void (*prepend_info)(GString *), end_string(str); } +#ifdef _WIN32 +typedef void (WINAPI *nativesi_func_ptr)(LPSYSTEM_INFO); +#endif + /* * Get various library run-time versions, and the OS version, and append * them to the specified GString. @@ -190,6 +194,7 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) #if defined(_WIN32) OSVERSIONINFOEX info; SYSTEM_INFO system_info; + nativesi_func_ptr nativesi_func; #elif defined(HAVE_SYS_UTSNAME_H) struct utsname name; #endif @@ -229,7 +234,13 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) } memset(&system_info, '\0', sizeof system_info); - GetSystemInfo(&system_info); /* only for W2K or greater .... (which is what we support) */ + /* Look for and use the GetNativeSystemInfo() function if available to get the correct processor + * architecture even when running 32-bit Wireshark in WOW64 (x86 emulation on 64-bit Windows) */ + nativesi_func = GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetNativeSystemInfo"); + if(nativesi_func) + nativesi_func(&system_info); + else + GetSystemInfo(&system_info); switch (info.dwPlatformId) { |