Don't use deprecated `GetVersionEx()`
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
We're using GetVersionEx() to set EG(windows_version_info), and also GetVersion() in php_get_uname() (the latter might reuse the former; I'll have a closer look). Both functions are deprecated, and the documentation states:
GetVersionExA may be altered or unavailable for releases after Windows 8.1. Instead, use the Version Helper functions.
Using the version helper functions in combination with GetProductInfo() is indeed an option, but changing EG(windows_version_info) to no longer hold an OSVERSIONINFOEX structure would be a BC break, which is exacerbated by the fact that we make the fields available as userland constants:
Either we find a way to populate the (relevant) fields of OSVERSIONINFOEX without calling any deprecated functions, or we may consider to deprecate some of the userland constants. Maybe we should do both.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Windows-specific code that populates EG(windows_version_info) and the GetVersion() call used by php_get_uname(), then compare them with the constants declared in main/main.stub.php. Determine whether the relevant OSVERSIONINFOEX fields can remain compatible without deprecated APIs, or whether affected userland constants need deprecation; done means the compatibility decision is documented and both deprecated calls are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100