FillZpp / sys-info-rs

Get system information in Rust.
MIT License
168 stars 57 forks source link

wrong version returned on windows #86

Open 0rphon opened 3 years ago

0rphon commented 3 years ago

im running Windows 10 pro version 20H2 build 19042.746 but os_release() returns version 6.2.9200

Spoonbender commented 3 years ago

As explained in https://github.com/denoland/deno/issues/9862 and in Microsoft documentation, this is because sys-info-rs uses the GetVersionEx Win32 API, which - since windows 8.1 - returns the version number the current process is manifested to (and for unmanifested apps - always returns 6.2.9200).

Seems like RtlGetVersion might do the trick instead, I'll try this one out

FillZpp commented 3 years ago

As explained in denoland/deno#9862 and in Microsoft documentation, this is because sys-info-rs uses the GetVersionEx Win32 API, which - since windows 8.1 - returns the version number the current process is manifested to (and for unmanifested apps - always returns 6.2.9200).

Seems like RtlGetVersion might do the trick instead, I'll try this one out

Thanks. I have no windows devices to do this test, please raise a pr if you could fix it.