Bug 1035125 Part 6: Take Chromium commit 3181ba39ee787e1b40f4aea4be23f4f666ad0945 to add Windows 10 version to enumeration. r?aklotz draft
authorBob Owen <bobowencode@gmail.com>
Sun, 15 May 2016 16:23:57 +0100
changeset 367183 c6ed4637b2963252d4bbbd8bb2a1aae7a4a80423
parent 367182 307a9453196e9d412d5efd2d7d0c1bcb86e5d33b
child 367184 02c7fc57b7e48867373576290cb872f583103711
push id18159
push userbobowencode@gmail.com
push dateSun, 15 May 2016 15:37:30 +0000
reviewersaklotz
bugs1035125
milestone49.0a1
Bug 1035125 Part 6: Take Chromium commit 3181ba39ee787e1b40f4aea4be23f4f666ad0945 to add Windows 10 version to enumeration. r?aklotz MozReview-Commit-ID: 8sR9F72JJ1k
security/sandbox/chromium/base/win/windows_version.cc
security/sandbox/chromium/base/win/windows_version.h
security/sandbox/moz-chromium-commit-status.txt
--- a/security/sandbox/chromium/base/win/windows_version.cc
+++ b/security/sandbox/chromium/base/win/windows_version.cc
@@ -59,16 +59,18 @@ OSInfo::OSInfo()
         // Treat Windows Server 2012 the same as Windows 8.
         version_ = VERSION_WIN8;
         break;
       default:
         DCHECK_EQ(version_number_.minor, 3);
         version_ = VERSION_WIN8_1;
         break;
     }
+  } else if (version_number_.major == 10) {
+    version_ = VERSION_WIN10;
   } else if (version_number_.major > 6) {
     NOTREACHED();
     version_ = VERSION_WIN_LAST;
   }
   service_pack_.major = version_info.wServicePackMajor;
   service_pack_.minor = version_info.wServicePackMinor;
 
   SYSTEM_INFO system_info = { 0 };
@@ -79,17 +81,17 @@ OSInfo::OSInfo()
     case PROCESSOR_ARCHITECTURE_IA64:  architecture_ = IA64_ARCHITECTURE; break;
   }
   processors_ = system_info.dwNumberOfProcessors;
   allocation_granularity_ = system_info.dwAllocationGranularity;
 
   GetProductInfoPtr get_product_info;
   DWORD os_type;
 
-  if (version_info.dwMajorVersion == 6) {
+  if (version_info.dwMajorVersion == 6 || version_info.dwMajorVersion == 10) {
     // Only present on Vista+.
     get_product_info = reinterpret_cast<GetProductInfoPtr>(
         ::GetProcAddress(::GetModuleHandle(L"kernel32.dll"), "GetProductInfo"));
 
     get_product_info(version_info.dwMajorVersion, version_info.dwMinorVersion,
                      0, 0, &os_type);
     switch (os_type) {
       case PRODUCT_CLUSTER_SERVER:
--- a/security/sandbox/chromium/base/win/windows_version.h
+++ b/security/sandbox/chromium/base/win/windows_version.h
@@ -21,17 +21,18 @@ namespace win {
 // "if (base::win::GetVersion() >= base::win::VERSION_VISTA) ...".
 enum Version {
   VERSION_PRE_XP = 0,  // Not supported.
   VERSION_XP,
   VERSION_SERVER_2003, // Also includes XP Pro x64 and Server 2003 R2.
   VERSION_VISTA,       // Also includes Windows Server 2008.
   VERSION_WIN7,        // Also includes Windows Server 2008 R2.
   VERSION_WIN8,        // Also includes Windows Server 2012.
-  VERSION_WIN8_1,      // Code named Windows Blue
+  VERSION_WIN8_1,      // Also includes Windows Server 2012 R2.
+  VERSION_WIN10,       // Also includes Windows 10 Server.
   VERSION_WIN_LAST,    // Indicates error condition.
 };
 
 // A rough bucketing of the available types of versions of Windows. This is used
 // to distinguish enterprise enabled versions from home versions and potentially
 // server versions.
 enum VersionType {
   SUITE_HOME,
--- a/security/sandbox/moz-chromium-commit-status.txt
+++ b/security/sandbox/moz-chromium-commit-status.txt
@@ -4,8 +4,10 @@ df7cc6c04725630dd4460f29d858a77507343b24
 b533d6533585377edd63ec6500469f6c4fba602a   chromium/sandbox/win/src/sharedmem_ipc_server.cc
 034bd64db1806d85b2ceacc736074ac07722af4a   chromium/sandbox/win/src/service_resolver_64.cc
 de2078cfbbb6770791d32575a1a72a288e6d66a6   chromium/sandbox/win/src/target_services.cc
 de2078cfbbb6770791d32575a1a72a288e6d66a6   chromium/sandbox/win/src/target_services.h
 0e49d029d5a1a25d971880b9e44d67ac70b31a80   chromium/sandbox/win/src/file_policy_test.cc
 0e49d029d5a1a25d971880b9e44d67ac70b31a80   chromium/sandbox/win/src/filesystem_policy.cc
 0e49d029d5a1a25d971880b9e44d67ac70b31a80   chromium/sandbox/win/src/win_utils.cc
 0e49d029d5a1a25d971880b9e44d67ac70b31a80   chromium/sandbox/win/src/win_utils.h
+3181ba39ee787e1b40f4aea4be23f4f666ad0945   chromium/base/win/windows_version.cc
+3181ba39ee787e1b40f4aea4be23f4f666ad0945   chromium/base/win/windows_version.h