Skip to content

Fix GH-7815: Report Windows 11, Server 2019 and 2022 in php_uname #7816

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

Closed

Conversation

Quppa
Copy link
Contributor

@Quppa Quppa commented Dec 23, 2021

Fixes #7815.

There isn't an easy way to query the OS version for Windows 11 and Windows Server, version 1709 and newer, but the build number can be used as a proxy.

The Windows 11 check is that buildNumber >= 22000, so relies on Microsoft not releasing a future version of Windows 10 with a build number higher than that (Windows 10 21H2 has the build number 19044).

@cmb69
Copy link
Member

cmb69 commented Dec 23, 2021

Thank you for the PR! Indeed, checking dwBuildNumber and mapping that to a more readable Windows version is the way to go, since it doesn't seem that the dwMajorVersion will change for Windows 11; actually, there is no distinction regarding the supportedOS in the manifest wrt. Windows 11 (we should update the comment there, though). And even though GetVersionEx is deprecated, the newer VerifyVersionInfo is either, and apparently there is no alternative function to get the info we're looking for.

However, I am reluctant to accept this as bug fix. While the current information is not quite right, it is not totally wrong either, and some application may rely on that, and may not be prepared for this change. I think we should treat this more like a new feature and target "master" only, or maybe target PHP-8.1 since this is probably not widely used at this time.

@Quppa
Copy link
Contributor Author

Quppa commented Dec 23, 2021

Makes sense - should I go ahead and create an RFC so this can be treated as a feature request?

@cmb69
Copy link
Member

cmb69 commented Dec 23, 2021

should I go ahead and create an RFC so this can be treated as a feature request?

That would be overkill in my opinion. I'm fine with merging into master, but not sure about PHP-8.1. Maybe @ramsey or @patrickallaert have an opinion.

@Quppa Quppa changed the base branch from PHP-8.0 to master December 23, 2021 11:49
@Quppa Quppa force-pushed the recognise-windows-11-server-2019-2022 branch from b70c140 to be8a7c4 Compare December 23, 2021 11:49
@Quppa Quppa force-pushed the recognise-windows-11-server-2019-2022 branch from c46a27a to ca20247 Compare December 23, 2021 11:53
@Quppa
Copy link
Contributor Author

Quppa commented Dec 23, 2021

Thanks - I've changed the PR to target master.

@krakjoe
Copy link
Member

krakjoe commented Dec 27, 2021

@cmb69 merge into 8.1 is fine

@cmb69 cmb69 closed this in f82593d Dec 27, 2021
@Quppa Quppa deleted the recognise-windows-11-server-2019-2022 branch December 27, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

php_uname doesn't recognise Windows 11 and Windows Server 2019/2022
3 participants