aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/openvpn/win32.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c
index 1787dca..e17cca1 100644
--- a/src/openvpn/win32.c
+++ b/src/openvpn/win32.c
@@ -1342,6 +1342,20 @@ win32_version_info()
}
}
+bool
+win32_is_64bit()
+{
+#if defined(_WIN64)
+ return true; // 64-bit programs run only on Win64
+#elif defined(_WIN32)
+ // 32-bit programs run on both 32-bit and 64-bit Windows
+ BOOL f64 = FALSE;
+ return IsWow64Process(GetCurrentProcess(), &f64) && f64;
+#else
+ return false; // Win64 does not support Win16
+#endif
+}
+
const char *
win32_version_string(struct gc_arena *gc, bool add_name)
{
@@ -1368,6 +1382,8 @@ win32_version_string(struct gc_arena *gc, bool add_name)
break;
}
+ buf_printf (&out, win32_is_64bit() ? " 64bit" : " 32bit");
+
return (const char *)out.data;
}