php / php/php-src

Don't use deprecated `GetVersionEx()`

オープン
#17,557 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Category: Engine Feature OS: Windows Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

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:

https://github.com/php/php-src/blob/10ccb6bf0d4593e7250ac699addf31deee82caa0/main/main.stub.php#L193-L232

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

EG(windows_version_info) に値を設定する Windows 固有のコードと、php_get_uname() で使用されている GetVersion() の呼び出しを見つけ、それらを main/main.stub.php で宣言されている定数と比較する。関連する OSVERSIONINFOEX フィールドが非推奨 API なしで互換性を維持できるか、影響を受ける userland 定数を非推奨にする必要があるかを判断する。互換性に関する判断が文書化され、2 つの非推奨の呼び出しに対応できれば完了とする。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
operating-systems
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。