Open Bug 1727663 Opened 3 years ago Updated 3 years ago

WindowsVersion.h uses deprecated VerifyVersionInfo


(Core :: MFBT, task)





(Reporter: handyman, Unassigned)



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.

[3] (toward the bottom)
(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).


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