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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 // the process does not have sufficient access rights to determine this. | 79 // the process does not have sufficient access rights to determine this. |
80 enum WOW64Status { | 80 enum WOW64Status { |
81 WOW64_DISABLED, | 81 WOW64_DISABLED, |
82 WOW64_ENABLED, | 82 WOW64_ENABLED, |
83 WOW64_UNKNOWN, | 83 WOW64_UNKNOWN, |
84 }; | 84 }; |
85 | 85 |
86 static OSInfo* GetInstance(); | 86 static OSInfo* GetInstance(); |
87 | 87 |
88 Version version() const { return version_; } | 88 Version version() const { return version_; } |
89 Version kernel32_version() const { return kernel32_version_; } | |
Will Harris
2016/03/09 23:02:50
how are none of these functions commented...? :)
scottmg
2016/03/10 00:41:31
Doesn't seem like comments would be very useful.
| |
89 // The next two functions return arrays of values, [major, minor(, build)]. | 90 // The next two functions return arrays of values, [major, minor(, build)]. |
90 VersionNumber version_number() const { return version_number_; } | 91 VersionNumber version_number() const { return version_number_; } |
91 VersionType version_type() const { return version_type_; } | 92 VersionType version_type() const { return version_type_; } |
92 ServicePack service_pack() const { return service_pack_; } | 93 ServicePack service_pack() const { return service_pack_; } |
93 WindowsArchitecture architecture() const { return architecture_; } | 94 WindowsArchitecture architecture() const { return architecture_; } |
94 int processors() const { return processors_; } | 95 int processors() const { return processors_; } |
95 size_t allocation_granularity() const { return allocation_granularity_; } | 96 size_t allocation_granularity() const { return allocation_granularity_; } |
96 WOW64Status wow64_status() const { return wow64_status_; } | 97 WOW64Status wow64_status() const { return wow64_status_; } |
97 std::string processor_model_name(); | 98 std::string processor_model_name(); |
98 | 99 |
99 // Like wow64_status(), but for the supplied handle instead of the current | 100 // Like wow64_status(), but for the supplied handle instead of the current |
100 // process. This doesn't touch member state, so you can bypass the singleton. | 101 // process. This doesn't touch member state, so you can bypass the singleton. |
101 static WOW64Status GetWOW64StatusForProcess(HANDLE process_handle); | 102 static WOW64Status GetWOW64StatusForProcess(HANDLE process_handle); |
102 | 103 |
103 private: | 104 private: |
104 OSInfo(); | 105 OSInfo(); |
105 ~OSInfo(); | 106 ~OSInfo(); |
106 | 107 |
107 Version version_; | 108 Version version_; |
109 Version kernel32_version_; | |
108 VersionNumber version_number_; | 110 VersionNumber version_number_; |
109 VersionType version_type_; | 111 VersionType version_type_; |
110 ServicePack service_pack_; | 112 ServicePack service_pack_; |
111 WindowsArchitecture architecture_; | 113 WindowsArchitecture architecture_; |
112 int processors_; | 114 int processors_; |
113 size_t allocation_granularity_; | 115 size_t allocation_granularity_; |
114 WOW64Status wow64_status_; | 116 WOW64Status wow64_status_; |
115 std::string processor_model_name_; | 117 std::string processor_model_name_; |
116 | 118 |
117 DISALLOW_COPY_AND_ASSIGN(OSInfo); | 119 DISALLOW_COPY_AND_ASSIGN(OSInfo); |
118 }; | 120 }; |
119 | 121 |
120 // Because this is by far the most commonly-requested value from the above | 122 // Because this is by far the most commonly-requested value from the above |
121 // singleton, we add a global-scope accessor here as syntactic sugar. | 123 // singleton, we add a global-scope accessor here as syntactic sugar. |
122 BASE_EXPORT Version GetVersion(); | 124 BASE_EXPORT Version GetVersion(); |
123 | 125 |
124 } // namespace win | 126 } // namespace win |
125 } // namespace base | 127 } // namespace base |
126 | 128 |
127 #endif // BASE_WIN_WINDOWS_VERSION_H_ | 129 #endif // BASE_WIN_WINDOWS_VERSION_H_ |
OLD | NEW |