summaryrefslogtreecommitdiff
path: root/vcl/win/app/salinst.cxx
diff options
context:
space:
mode:
authorkubak <kuba@openoffice.com.pl>2024-05-05 00:51:50 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2024-05-11 17:46:31 +0200
commitdc03e4fd524384963bafc529d0843d048e159106 (patch)
tree70e0a882d415c769df3fe62a5425892ec77e1bba /vcl/win/app/salinst.cxx
parent016d61f529f9d9ec2520fb7a808da41cf17d7295 (diff)
tdf#96671 - Correctly detect windows 64-bit OS
Adds detection: - Windows X86_64, - Windows X86_32 - WoW64 (Windows 32 on Windows 64). Change-Id: Ic40ec8bdfb206a7ad3045edf7ecef3cb97cc08f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167144 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/win/app/salinst.cxx')
-rw-r--r--vcl/win/app/salinst.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 4fc2b5e57e72..1a047853a3e1 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -948,10 +948,31 @@ typedef LONG NTSTATUS;
typedef NTSTATUS(WINAPI* RtlGetVersion_t)(PRTL_OSVERSIONINFOW);
constexpr NTSTATUS STATUS_SUCCESS = 0x00000000;
+static OUString getWinBits()
+{
+#if _WIN64
+
+ return " X86_64";
+
+#else
+
+ BOOL isWow64 = FALSE;
+
+ IsWow64Process(GetCurrentProcess(), &isWow64);
+
+ if (isWow64)
+ return " X86_64"; //32-bit process on 64-bit Windows.
+ else
+ return " X86_32";
+
+#endif
+}
+
static OUString getOSVersionString(const OUString& aNtVersionString, DWORD nBuildNumber)
{
+ OUString winArch = getWinBits();
OUString aVersionPlusBuild
- = " (" + aNtVersionString + " build " + OUString::number(nBuildNumber) + ")";
+ = winArch + " (" + aNtVersionString + " build " + OUString::number(nBuildNumber) + ")";
if (aNtVersionString == "6.1")
return "Windows 7 Service Pack 1" + aVersionPlusBuild;