vcl/win/app/salinst.cxx |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

New commits:
commit dc03e4fd524384963bafc529d0843d048e159106
Author:     kubak <[email protected]>
AuthorDate: Sun May 5 00:51:50 2024 +0200
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sat May 11 17:46:31 2024 +0200

    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 <[email protected]>
    Tested-by: Jenkins

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;

Reply via email to