OLD | NEW |
---|---|
1 // Copyright (c) 2010 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 typedef void* HANDLE; | |
10 | |
9 namespace base { | 11 namespace base { |
10 namespace win { | 12 namespace win { |
11 | 13 |
12 // NOTE: Keep these in order so callers can do things like | 14 // NOTE: Keep these in order so callers can do things like |
13 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, | 15 // "if (GetWinVersion() > WINVERSION_2000) ...". It's OK to change the values, |
14 // though. | 16 // though. |
15 enum Version { | 17 enum Version { |
16 VERSION_PRE_2000 = 0, // Not supported | 18 VERSION_PRE_2000 = 0, // Not supported |
17 VERSION_2000 = 1, // Not supported | 19 VERSION_2000 = 1, // Not supported |
18 VERSION_XP = 2, | 20 VERSION_XP = 2, |
19 VERSION_SERVER_2003 = 3, | 21 VERSION_SERVER_2003 = 3, |
20 VERSION_VISTA = 4, | 22 VERSION_VISTA = 4, |
21 VERSION_2008 = 5, | 23 VERSION_2008 = 5, |
22 VERSION_WIN7 = 6, | 24 VERSION_WIN7 = 6, |
23 }; | 25 }; |
24 | 26 |
25 // Returns the running version of Windows. | 27 // Returns the running version of Windows. |
26 Version GetVersion(); | 28 Version GetVersion(); |
27 | 29 |
28 // Returns the major and minor version of the service pack installed. | 30 // Returns the major and minor version of the service pack installed. |
29 void GetServicePackLevel(int* major, int* minor); | 31 void GetServicePackLevel(int* major, int* minor); |
30 | 32 |
33 enum WOW64Status { | |
34 WOW64_DISABLED, | |
35 WOW64_ENABLED, | |
36 WOW64_UNKNOWN, | |
37 }; | |
38 | |
39 // Returns whether this process is running under WOW64 (the wrapper that allows | |
40 // 32-bit processes to run on 64-bit versions of Windows). This will return | |
41 // WOW64_DISABLED for both "32-bit Chrome on 32-bit Windows" and "64-bit Chrome | |
42 // on 64-bit Windows". WOW64_UNKNOWN means "an error occurred", e.g. the | |
43 // process does not have sufficient access rights to determine this. | |
44 WOW64Status GetWOW64Status(); | |
45 | |
46 // Like GetWOW64Status(), but for the supplied handle instead of the current | |
47 // process. | |
48 WOW64Status GetWOW64StatusForHandle(HANDLE handle); | |
brettw
2011/03/03 22:28:53
Maybe call this process_handle to make more clear
Peter Kasting
2011/03/03 22:33:23
I went one better than this and also changed the A
| |
49 | |
31 } // namespace win | 50 } // namespace win |
32 } // namespace base | 51 } // namespace base |
33 | 52 |
34 #endif // BASE_WIN_WINDOWS_VERSION_H_ | 53 #endif // BASE_WIN_WINDOWS_VERSION_H_ |
OLD | NEW |