RFR: 8286424: GetVersionEx is deprecated
Kim Barrett
kbarrett at openjdk.java.net
Tue May 10 14:57:50 UTC 2022
On Tue, 10 May 2022 03:11:49 GMT, David Holmes <dholmes at openjdk.org> wrote:
> AFAICS both uses of this only try to determine whether we are running a server or client/workstation version - and for that the `IsWindowsServer()` API exists:
>
> https://docs.microsoft.com/en-us/windows/win32/api/versionhelpers/nf-versionhelpers-iswindowsserver
You are right! I just assumed that in print_windows_version it was making
further use of the info from GetVersionEx further down. But it's not!
Because of that, I missed that IsWindowsServer could serve as a replacement.
Thanks for spotting that; I'll make that change instead.
> But the fix itself is fine for silencing the deprecation warning (a deprecation that I didn't find documented ??).
https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa
"GetVersionExA may be altered or unavailable for releases after Windows 8.1. Instead, use the Version Helper functions."
That sounds like "deprecated" without actually using that word, and a reasonable excuse for the compiler warning.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8611
More information about the hotspot-runtime-dev
mailing list