OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_WIN_WINDOWS_VERSION_H_ | 5 #ifndef BASE_WIN_WINDOWS_VERSION_H_ |
6 #define BASE_WIN_WINDOWS_VERSION_H_ | 6 #define BASE_WIN_WINDOWS_VERSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/base_api.h" |
| 10 |
9 typedef void* HANDLE; | 11 typedef void* HANDLE; |
10 | 12 |
11 namespace base { | 13 namespace base { |
12 namespace win { | 14 namespace win { |
13 | 15 |
14 // NOTE: Keep these in order so callers can do things like | 16 // NOTE: Keep these in order so callers can do things like |
15 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, | 17 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, |
16 // though. | 18 // though. |
17 enum Version { | 19 enum Version { |
18 VERSION_PRE_2000 = 0, // Not supported | 20 VERSION_PRE_2000 = 0, // Not supported |
19 VERSION_2000 = 1, // Not supported | 21 VERSION_2000 = 1, // Not supported |
20 VERSION_XP = 2, | 22 VERSION_XP = 2, |
21 VERSION_SERVER_2003 = 3, // Also includes Windows XP Professional x64 edition | 23 VERSION_SERVER_2003 = 3, // Also includes Windows XP Professional x64 edition |
22 VERSION_VISTA = 4, | 24 VERSION_VISTA = 4, |
23 VERSION_2008 = 5, | 25 VERSION_2008 = 5, |
24 VERSION_WIN7 = 6, | 26 VERSION_WIN7 = 6, |
25 }; | 27 }; |
26 | 28 |
27 // Returns the running version of Windows. | 29 // Returns the running version of Windows. |
28 Version GetVersion(); | 30 BASE_API Version GetVersion(); |
29 | 31 |
30 // Returns the major and minor version of the service pack installed. | 32 // Returns the major and minor version of the service pack installed. |
31 void GetServicePackLevel(int* major, int* minor); | 33 BASE_API void GetServicePackLevel(int* major, int* minor); |
32 | 34 |
33 enum WindowsArchitecture { | 35 enum WindowsArchitecture { |
34 X86_ARCHITECTURE, | 36 X86_ARCHITECTURE, |
35 X64_ARCHITECTURE, | 37 X64_ARCHITECTURE, |
36 IA64_ARCHITECTURE, | 38 IA64_ARCHITECTURE, |
37 OTHER_ARCHITECTURE, | 39 OTHER_ARCHITECTURE, |
38 }; | 40 }; |
39 | 41 |
40 // Returns the processor architecture this copy of Windows natively uses. | 42 // Returns the processor architecture this copy of Windows natively uses. |
41 // For example, given an x64-capable processor, we have three possibilities: | 43 // For example, given an x64-capable processor, we have three possibilities: |
42 // 32-bit Chrome running on 32-bit Windows: X86_ARCHITECTURE | 44 // 32-bit Chrome running on 32-bit Windows: X86_ARCHITECTURE |
43 // 32-bit Chrome running on 64-bit Windows via WOW64: X64_ARCHITECTURE | 45 // 32-bit Chrome running on 64-bit Windows via WOW64: X64_ARCHITECTURE |
44 // 64-bit Chrome running on 64-bit Windows: X64_ARCHITECTURE | 46 // 64-bit Chrome running on 64-bit Windows: X64_ARCHITECTURE |
45 WindowsArchitecture GetWindowsArchitecture(); | 47 BASE_API WindowsArchitecture GetWindowsArchitecture(); |
46 | 48 |
47 enum WOW64Status { | 49 enum WOW64Status { |
48 WOW64_DISABLED, | 50 WOW64_DISABLED, |
49 WOW64_ENABLED, | 51 WOW64_ENABLED, |
50 WOW64_UNKNOWN, | 52 WOW64_UNKNOWN, |
51 }; | 53 }; |
52 | 54 |
53 // Returns whether this process is running under WOW64 (the wrapper that allows | 55 // Returns whether this process is running under WOW64 (the wrapper that allows |
54 // 32-bit processes to run on 64-bit versions of Windows). This will return | 56 // 32-bit processes to run on 64-bit versions of Windows). This will return |
55 // WOW64_DISABLED for both "32-bit Chrome on 32-bit Windows" and "64-bit Chrome | 57 // WOW64_DISABLED for both "32-bit Chrome on 32-bit Windows" and "64-bit Chrome |
56 // on 64-bit Windows". WOW64_UNKNOWN means "an error occurred", e.g. the | 58 // on 64-bit Windows". WOW64_UNKNOWN means "an error occurred", e.g. the |
57 // process does not have sufficient access rights to determine this. | 59 // process does not have sufficient access rights to determine this. |
58 WOW64Status GetWOW64Status(); | 60 BASE_API WOW64Status GetWOW64Status(); |
59 | 61 |
60 // Like GetWOW64Status(), but for the supplied handle instead of the current | 62 // Like GetWOW64Status(), but for the supplied handle instead of the current |
61 // process. | 63 // process. |
62 WOW64Status GetWOW64StatusForProcess(HANDLE process_handle); | 64 BASE_API WOW64Status GetWOW64StatusForProcess(HANDLE process_handle); |
63 | 65 |
64 } // namespace win | 66 } // namespace win |
65 } // namespace base | 67 } // namespace base |
66 | 68 |
67 #endif // BASE_WIN_WINDOWS_VERSION_H_ | 69 #endif // BASE_WIN_WINDOWS_VERSION_H_ |
OLD | NEW |