summaryrefslogtreecommitdiff
path: root/desktop
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
commitc183b56839f52b1c16d600cf8172a67522ac7528 (patch)
tree3c8d10ae7b809979f65c0059b15516e596d328ee /desktop
parent69adeb47391412ea0328055d3773d5b6ce0d00a6 (diff)
dv17: #i108414#: Check for existance of GetNativeSystemInfo before using this function
Diffstat (limited to 'desktop')
-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 c51dcd105bfd..6a43f20ebb22 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 );