| 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 #include "base/win/windows_version.h" | 5 #include "base/win/windows_version.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 } else if (version_number_.major == 10) { | 67 } else if (version_number_.major == 10) { |
| 68 version_ = VERSION_WIN10; | 68 version_ = VERSION_WIN10; |
| 69 } else if (version_number_.major > 6) { | 69 } else if (version_number_.major > 6) { |
| 70 NOTREACHED(); | 70 NOTREACHED(); |
| 71 version_ = VERSION_WIN_LAST; | 71 version_ = VERSION_WIN_LAST; |
| 72 } | 72 } |
| 73 service_pack_.major = version_info.wServicePackMajor; | 73 service_pack_.major = version_info.wServicePackMajor; |
| 74 service_pack_.minor = version_info.wServicePackMinor; | 74 service_pack_.minor = version_info.wServicePackMinor; |
| 75 | 75 |
| 76 SYSTEM_INFO system_info = { 0 }; | 76 SYSTEM_INFO system_info = {}; |
| 77 ::GetNativeSystemInfo(&system_info); | 77 ::GetNativeSystemInfo(&system_info); |
| 78 switch (system_info.wProcessorArchitecture) { | 78 switch (system_info.wProcessorArchitecture) { |
| 79 case PROCESSOR_ARCHITECTURE_INTEL: architecture_ = X86_ARCHITECTURE; break; | 79 case PROCESSOR_ARCHITECTURE_INTEL: architecture_ = X86_ARCHITECTURE; break; |
| 80 case PROCESSOR_ARCHITECTURE_AMD64: architecture_ = X64_ARCHITECTURE; break; | 80 case PROCESSOR_ARCHITECTURE_AMD64: architecture_ = X64_ARCHITECTURE; break; |
| 81 case PROCESSOR_ARCHITECTURE_IA64: architecture_ = IA64_ARCHITECTURE; break; | 81 case PROCESSOR_ARCHITECTURE_IA64: architecture_ = IA64_ARCHITECTURE; break; |
| 82 } | 82 } |
| 83 processors_ = system_info.dwNumberOfProcessors; | 83 processors_ = system_info.dwNumberOfProcessors; |
| 84 allocation_granularity_ = system_info.dwAllocationGranularity; | 84 allocation_granularity_ = system_info.dwAllocationGranularity; |
| 85 | 85 |
| 86 GetProductInfoPtr get_product_info; | 86 GetProductInfoPtr get_product_info; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 return WOW64_UNKNOWN; | 169 return WOW64_UNKNOWN; |
| 170 return is_wow64 ? WOW64_ENABLED : WOW64_DISABLED; | 170 return is_wow64 ? WOW64_ENABLED : WOW64_DISABLED; |
| 171 } | 171 } |
| 172 | 172 |
| 173 Version GetVersion() { | 173 Version GetVersion() { |
| 174 return OSInfo::GetInstance()->version(); | 174 return OSInfo::GetInstance()->version(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace win | 177 } // namespace win |
| 178 } // namespace base | 178 } // namespace base |
| OLD | NEW |