I wrote a piece of code to retrieve windows major and minor version using GetVersionEx function, but this function always returns major version 6 and minor version 2.
MSDN is saying to use Version Helper APIs to find the current OS. I built the project in windows 8.1 and referred Windows 8.1 kits path to include VersionHelpers header file. There is no IsWindows10OrGreater() function available in VersionHelpers header file.
So I downloaded VersionHelper header file from GitHub and added into my project. Compile error gone but IsWindows10OrGreater function is getting fail.
Am i doing anything wrong?
The VersionHelper functions are simply wrappers for VerifyVersionInfo()
. Starting in Windows 10, VerifyVersionInfo()
is now subject to the same version manifestation rules that GetVersionEx()
is subject to. To get the true OS version regardless of manifestation, you can use RtlGetVersion()
, NetServerGetInfo()
, or NetWkstaGetInfo()
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With