Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong version returned on windows #86

Open
0rphon opened this issue Feb 5, 2021 · 2 comments
Open

wrong version returned on windows #86

0rphon opened this issue Feb 5, 2021 · 2 comments

Comments

@0rphon
Copy link

0rphon commented Feb 5, 2021

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

@Spoonbender
Copy link

Spoonbender commented Apr 1, 2021

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

@FillZpp
Copy link
Owner

FillZpp commented Apr 9, 2021

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.

ejnguyen pushed a commit to ejnguyen/buck2 that referenced this issue Apr 29, 2024
Summary:
Right now, we rely on the sys_info library to get the OS version.

However, that functionality is broken for Windows: FillZpp/sys-info-rs#86
Specifically, it produces `6.2.9200` for all versions across Windows: https://fburl.com/scuba/buck2_builds/iq6hsudp

This diff swaps the check to use the winver library, which has much better
support for fetching the Windows version.

Reviewed By: JakobDegen

Differential Revision: D56546196
facebook-github-bot pushed a commit to facebook/buck2 that referenced this issue Apr 29, 2024
Summary:
Right now, we rely on the sys_info library to get the OS version.

However, that functionality is broken for Windows: FillZpp/sys-info-rs#86
Specifically, it produces `6.2.9200` for all versions across Windows: https://fburl.com/scuba/buck2_builds/iq6hsudp

This diff swaps the check to use the winver library, which has much better
support for fetching the Windows version.

Reviewed By: JakobDegen

Differential Revision: D56546196

fbshipit-source-id: 98d94d70bf92c0965002631e07cbb35d6118eaff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants