Commit e99aceb4 authored by Will Harris's avatar Will Harris Committed by Commit Bot

Add Windows 20H2/1909/19042 support in base::win::Version.

BUG=1140170

Change-Id: Ia48e945f7b0c16d76daa28a12bf63afd646d2224
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485149Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819968}
parent a82896d3
...@@ -256,6 +256,8 @@ OSInfo::WOW64Status OSInfo::GetWOW64StatusForProcess(HANDLE process_handle) { ...@@ -256,6 +256,8 @@ OSInfo::WOW64Status OSInfo::GetWOW64StatusForProcess(HANDLE process_handle) {
// static // static
Version OSInfo::MajorMinorBuildToVersion(int major, int minor, int build) { Version OSInfo::MajorMinorBuildToVersion(int major, int minor, int build) {
if (major == 10) { if (major == 10) {
if (build >= 19042)
return Version::WIN10_20H2;
if (build >= 19041) if (build >= 19041)
return Version::WIN10_20H1; return Version::WIN10_20H1;
if (build >= 18363) if (build >= 18363)
......
...@@ -49,6 +49,7 @@ enum class Version { ...@@ -49,6 +49,7 @@ enum class Version {
WIN10_19H1 = 14, // 19H1: Version 1903, Build 18362. WIN10_19H1 = 14, // 19H1: Version 1903, Build 18362.
WIN10_19H2 = 15, // 19H2: Version 1909, Build 18363. WIN10_19H2 = 15, // 19H2: Version 1909, Build 18363.
WIN10_20H1 = 16, // 20H1: Version 2004, Build 19041. WIN10_20H1 = 16, // 20H1: Version 2004, Build 19041.
WIN10_20H2 = 17, // 20H2: Version 2009, Build 19042.
WIN_LAST, // Indicates error condition. WIN_LAST, // Indicates error condition.
}; };
......
...@@ -24,7 +24,9 @@ TEST(WindowsVersion, GetVersionExAndKernelOsVersionMatch) { ...@@ -24,7 +24,9 @@ TEST(WindowsVersion, GetVersionExAndKernelOsVersionMatch) {
TEST(OSInfo, MajorMinorBuildToVersion) { TEST(OSInfo, MajorMinorBuildToVersion) {
EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 32767), EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 32767),
Version::WIN10_20H1); Version::WIN10_20H2);
EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 19042),
Version::WIN10_20H2);
EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 19041), EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 19041),
Version::WIN10_20H1); Version::WIN10_20H1);
EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 18363), EXPECT_EQ(OSInfo::MajorMinorBuildToVersion(10, 0, 18363),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment