OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 }; | 87 }; |
88 | 88 |
89 static OSInfo* GetInstance(); | 89 static OSInfo* GetInstance(); |
90 | 90 |
91 Version version() const { return version_; } | 91 Version version() const { return version_; } |
92 Version Kernel32Version() const; | 92 Version Kernel32Version() const; |
93 // The next two functions return arrays of values, [major, minor(, build)]. | 93 // The next two functions return arrays of values, [major, minor(, build)]. |
94 VersionNumber version_number() const { return version_number_; } | 94 VersionNumber version_number() const { return version_number_; } |
95 VersionType version_type() const { return version_type_; } | 95 VersionType version_type() const { return version_type_; } |
96 ServicePack service_pack() const { return service_pack_; } | 96 ServicePack service_pack() const { return service_pack_; } |
| 97 std::string service_pack_str() const { return service_pack_str_; } |
97 WindowsArchitecture architecture() const { return architecture_; } | 98 WindowsArchitecture architecture() const { return architecture_; } |
98 int processors() const { return processors_; } | 99 int processors() const { return processors_; } |
99 size_t allocation_granularity() const { return allocation_granularity_; } | 100 size_t allocation_granularity() const { return allocation_granularity_; } |
100 WOW64Status wow64_status() const { return wow64_status_; } | 101 WOW64Status wow64_status() const { return wow64_status_; } |
101 std::string processor_model_name(); | 102 std::string processor_model_name(); |
102 | 103 |
103 // Like wow64_status(), but for the supplied handle instead of the current | 104 // Like wow64_status(), but for the supplied handle instead of the current |
104 // process. This doesn't touch member state, so you can bypass the singleton. | 105 // process. This doesn't touch member state, so you can bypass the singleton. |
105 static WOW64Status GetWOW64StatusForProcess(HANDLE process_handle); | 106 static WOW64Status GetWOW64StatusForProcess(HANDLE process_handle); |
106 | 107 |
107 private: | 108 private: |
108 OSInfo(); | 109 OSInfo(); |
109 ~OSInfo(); | 110 ~OSInfo(); |
110 | 111 |
111 Version version_; | 112 Version version_; |
112 mutable Version kernel32_version_; | 113 mutable Version kernel32_version_; |
113 mutable bool got_kernel32_version_; | 114 mutable bool got_kernel32_version_; |
114 VersionNumber version_number_; | 115 VersionNumber version_number_; |
115 VersionType version_type_; | 116 VersionType version_type_; |
116 ServicePack service_pack_; | 117 ServicePack service_pack_; |
| 118 |
| 119 // A string, such as "Service Pack 3", that indicates the latest Service Pack |
| 120 // installed on the system. If no Service Pack has been installed, the string |
| 121 // is empty. |
| 122 std::string service_pack_str_; |
117 WindowsArchitecture architecture_; | 123 WindowsArchitecture architecture_; |
118 int processors_; | 124 int processors_; |
119 size_t allocation_granularity_; | 125 size_t allocation_granularity_; |
120 WOW64Status wow64_status_; | 126 WOW64Status wow64_status_; |
121 std::string processor_model_name_; | 127 std::string processor_model_name_; |
122 | 128 |
123 DISALLOW_COPY_AND_ASSIGN(OSInfo); | 129 DISALLOW_COPY_AND_ASSIGN(OSInfo); |
124 }; | 130 }; |
125 | 131 |
126 // Because this is by far the most commonly-requested value from the above | 132 // Because this is by far the most commonly-requested value from the above |
127 // singleton, we add a global-scope accessor here as syntactic sugar. | 133 // singleton, we add a global-scope accessor here as syntactic sugar. |
128 BASE_EXPORT Version GetVersion(); | 134 BASE_EXPORT Version GetVersion(); |
129 | 135 |
130 } // namespace win | 136 } // namespace win |
131 } // namespace base | 137 } // namespace base |
132 | 138 |
133 #endif // BASE_WIN_WINDOWS_VERSION_H_ | 139 #endif // BASE_WIN_WINDOWS_VERSION_H_ |
OLD | NEW |