windows_version.h revision 731df977c0511bca2206b5f333555b1205ff1f43
1// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_WIN_WINDOWS_VERSION_H_
6#define BASE_WIN_WINDOWS_VERSION_H_
7#pragma once
8
9namespace base {
10namespace win {
11
12// NOTE: Keep these in order so callers can do things like
13// "if (GetWinVersion() > WINVERSION_2000) ...".  It's OK to change the values,
14// though.
15enum Version {
16  VERSION_PRE_2000 = 0,  // Not supported
17  VERSION_2000 = 1,      // Not supported
18  VERSION_XP = 2,
19  VERSION_SERVER_2003 = 3,
20  VERSION_VISTA = 4,
21  VERSION_2008 = 5,
22  VERSION_WIN7 = 6,
23};
24
25// Returns the running version of Windows.
26Version GetVersion();
27
28// Returns the major and minor version of the service pack installed.
29void GetServicePackLevel(int* major, int* minor);
30
31}  // namespace win
32}  // namespace base
33
34#endif  // BASE_WIN_WINDOWS_VERSION_H_
35