summaryrefslogtreecommitdiff
path: root/desktop/win32
diff options
context:
space:
mode:
authorDirk Voelzke <dv@openoffice.org>2010-01-26 13:17:13 +0100
committerDirk Voelzke <dv@openoffice.org>2010-01-26 13:17:13 +0100
commit03623b746897144df193b3a13b9e94a89f7ef339 (patch)
tree2b76c905a6f3c0660ecf4822279d97192a9f1a93 /desktop/win32
parentc5bc7c6937277571758711f8c2f7b4aa6bc5f9b7 (diff)
dv17: #i108414#: Check for existance of GetNativeSystemInfo before using this function
Diffstat (limited to 'desktop/win32')
-rwxr-xr-x[-rw-r--r--]desktop/win32/source/setup/setup.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp
index 23ba22e049..abebcfde8c 100644..100755
--- a/desktop/win32/source/setup/setup.cpp
+++ b/desktop/win32/source/setup/setup.cpp
@@ -1981,7 +1981,30 @@ boolean SetupAppX::InstallRuntimes()
TCHAR *sRuntimePath = 0;
SYSTEM_INFO siSysInfo;
- GetNativeSystemInfo(&siSysInfo);
+ HMODULE hKernel32 = ::LoadLibrary(_T("Kernel32.dll"));
+ if ( hKernel32 != NULL )
+ {
+ typedef void (CALLBACK* pfnGetNativeSystemInfo_t)(LPSYSTEM_INFO);
+ pfnGetNativeSystemInfo_t pfnGetNativeSystemInfo;
+ pfnGetNativeSystemInfo = (pfnGetNativeSystemInfo_t)::GetProcAddress(hKernel32, "GetNativeSystemInfo");
+ if ( pfnGetNativeSystemInfo != NULL )
+ {
+ pfnGetNativeSystemInfo(&siSysInfo);
+ }
+ else
+ {
+ // GetNativeSystemInfo does not exist. Maybe the code is running under Windows 2000.
+ // Use GetSystemInfo instead.
+ GetSystemInfo(&siSysInfo);
+ }
+ FreeLibrary(hKernel32);
+ }
+ else
+ {
+ // Failed to check Kernel32.dll. There may be something wrong.
+ // Use GetSystemInfo instead anyway.
+ GetSystemInfo(&siSysInfo);
+ }
OutputDebugStringFormat( TEXT( "found architecture<%d>\r\n" ), siSysInfo.wProcessorArchitecture );