Chromium Code Reviews| 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) && |
|
rvargas (doing something else)
2011/04/06 23:28:05
nit: I think this should be indented like an if (u
Peter Kasting
2011/04/07 00:29:19
ifs are indent-4 too. It coincidentally happens t
|
| + (base::win::OSInfo::GetInstance()->service_pack()[0] >= 2)); |
| } |
| void InitObjectAttribs(const std::wstring& name, ULONG attributes, HANDLE root, |