On Fri, 24 Jul 2026 06:44:48 GMT, Matthias Baesken <[email protected]> wrote:
>> Matthias Baesken has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> handle also Win 10/11/Server 2016 and higher
>
> src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp line
> 420:
>
>> 418: osvi.dwMajorVersion > 4)
>> 419: {
>> 420: if (osvi.dwMajorVersion >= 6 && osvi.dwMinorVersion == 0) {
>
> One little additional remark - this check so far detects Win10 and Win11
> (both have dwMajorVersion 10 and dwMinorVersion 0) as OS_VISTA , should be
> considered.
This code does look weird, but what you have in the updated version looks very
wrong.
Right now the existing code (before your fix) would identify windows 10/11 as
vista .. but with your fix it would not identify it at all.
Except what actually happens depends on
https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoa
"For applications that have been manifested for Windows 8.1 or Windows 10.
Applications not manifested for Windows 8.1 or Windows 10 will return the
Windows 8 OS version value (6.2). "
.. so if we are not manifested your new code would report 6.2 (windows 8) but
we'd call it windows 7 .. but if we are manifested we'd completely fail.
That's how I read the docs.
And are we manifested ? And what as ?
based on a reading of
https://learn.microsoft.com/en-us/windows/win32/w8cookbook/windows-version-check
and the following file being passed to mt.exe and applied to java.exe and
javaw.exe
src/java.base/windows/native/launcher/java.manifest
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
....
I'd say we see that we are windows 10. This needs to be verified by testing,
which I can't do until mid-next week.
Also depending on the manifest isn't ideal ! We have no direct control over
that.
Perhaps if we really no longer have a reason to care what the version is then
the whole lot can be ditched. Or perhaps it should be completely changed ?
GetVersionEx is in fact deprecated.
https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexw
So this isn't looking to me like a simple clean up fix.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32011#discussion_r3648007735