aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/os.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/os.hpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/os.hpp b/src/os.hpp
index c9a89a1..6734fb4 100644
--- a/src/os.hpp
+++ b/src/os.hpp
@@ -11,7 +11,17 @@
namespace os
{
- OSVERSIONINFOW get_version_info();
+ inline OSVERSIONINFOW get_version_info()
+ {
+ OSVERSIONINFOW info;
+ ZeroMemory(&info, sizeof(info));
+ info.dwOSVersionInfoSize = sizeof(info);
+
+ if (!GetVersionExW(&info))
+ error::raise("GetVersionExW");
+
+ return info;
+ }
inline bool is_vista_or_later(const OSVERSIONINFOW& info)
{