Open Bug 1727663 Opened 3 years ago Updated 3 years ago

WindowsVersion.h uses deprecated VerifyVersionInfo

Categories

(Core :: MFBT, task)

Unspecified
Windows
task

Tracking

()

People

(Reporter: handyman, Unassigned)

References

Details

I'm not sure how the IsWindowsBuild* functions, which test for a specific build, can be implemented without VerifyVersionInfo (deprecated in Windows 10 [1]) but the IsWindows*OrLater can simply forward to the Windows IsWindows*OrGreater methods.
Although it would probably be better to remove the functions and replace all uses.

The Windows functions are inline-defined (to use VerifyVersionInfo). Looks like they were introduced with the SDK for Windows 8.1 [2].

I don't know how the repercussions of the deprecation will manifest but this came up while trying to implement a IsWindows11OrLater, which might be doable using trial-and-error with VerifyVersionInfo to get a value. But there is no _WIN32_WINNT_WIN11 or NTDDI_WIN11 defined in the latest SDK (or SDK beta, 10.0.22000.160, which is for Windows 11 [3]) and, since the function is deprecated, it might not be great to mine it for data [4].

Note: mfbt/WindowsVersion.h doesn't use the _WIN32_WINNT_WIN* macros but the values it uses come from there.


[1] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-verifyversioninfow
[2] https://docs.microsoft.com/en-us/windows/win32/sysinfo/version-helper-apis
[3] https://blogs.windows.com/windows-insider/2021/08/19/announcing-windows-11-insider-preview-build-22000-160/ (toward the bottom)
[4]https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/shared/sdkddkver.h
(that is not the latest but even the Insider SDK doesn't add anything useful)

See Also: → 1718629

It does not make sense to convert VerifyVersionInfo to IsWindows*OrGreater because the latter just calls the former. Even the official documentation [1] explains that:

The Version Helper functions use the VerifyVersionInfo function, so the behavior IsWindows8Point1OrGreater and IsWindows10OrGreater are similarly affected by the presence and content of the manifest.

Just ignore the Microsoft nonsense.

IsWin11OrLater would be implemented as IsWindows10BuildOrLater(22000).

[1] https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-verifyversioninfow

You need to log in before you can comment on or make changes to this bug.