Index: sandbox/src/sandbox_utils.cc |
=================================================================== |
--- sandbox/src/sandbox_utils.cc (revision 80667) |
+++ sandbox/src/sandbox_utils.cc (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -7,6 +7,7 @@ |
#include <windows.h> |
#include "base/logging.h" |
+#include "base/win/windows_version.h" |
#include "sandbox/src/internal_types.h" |
#include "sandbox/src/nt_internals.h" |
@@ -56,33 +57,10 @@ |
} |
bool IsXPSP2OrLater() { |
- OSVERSIONINFOEX version = {0}; |
- version.dwOSVersionInfoSize = sizeof(version); |
- if (!::GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&version))) { |
- NOTREACHED(); |
- return false; |
- } |
- |
- // Vista or later |
- if (version.dwMajorVersion > 5) |
- return true; |
- |
- // 2k, xp or 2003 |
- if (version.dwMajorVersion == 5) { |
- // 2003 |
- if (version.dwMinorVersion > 1) |
- return true; |
- |
- // 2000 |
- if (version.dwMinorVersion == 0) |
- return false; |
- |
- // Windows Xp Sp2 or later |
- if (version.wServicePackMajor >= 2) |
- return true; |
- } |
- |
- return false; |
+ base::win::Version version = base::win::GetVersion(); |
+ return (version > base::win::VERSION_XP) || |
+ ((version == base::win::VERSION_XP) && |
+ (base::win::OSInfo::GetInstance()->service_pack().major >= 2)); |
} |
void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root, |