diff options
Diffstat (limited to 'base/win/windows_version.cc')
-rw-r--r-- | base/win/windows_version.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/base/win/windows_version.cc b/base/win/windows_version.cc index f0c94e2..c130e0e 100644 --- a/base/win/windows_version.cc +++ b/base/win/windows_version.cc @@ -7,6 +7,8 @@ #include <windows.h> #include "base/logging.h" +#include "base/utf_string_conversions.h" +#include "base/win/registry.h" namespace base { namespace win { @@ -76,6 +78,18 @@ OSInfo::OSInfo() OSInfo::~OSInfo() { } +std::string OSInfo::processor_model_name() { + if (processor_model_name_.empty()) { + const wchar_t kProcessorNameString[] = + L"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"; + base::win::RegKey key(HKEY_LOCAL_MACHINE, kProcessorNameString, KEY_READ); + string16 value; + key.ReadValue(L"ProcessorNameString", &value); + processor_model_name_ = UTF16ToUTF8(value); + } + return processor_model_name_; +} + // static OSInfo::WOW64Status OSInfo::GetWOW64StatusForProcess(HANDLE process_handle) { typedef BOOL (WINAPI* IsWow64ProcessFunc)(HANDLE, PBOOL); |