2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG.
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
22 #include <windows.h>
\r
29 static std::wstring get_cpu_info()
\r
31 std::wstring cpu_name = L"Unknown CPU";
\r
33 DWORD dwType, dwSize;
\r
34 if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
\r
36 wchar_t p_name_str[1024];
\r
39 dwSize = sizeof(p_name_str);
\r
41 if(RegQueryValueEx(hkey, TEXT("ProcessorNameString"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)
\r
42 cpu_name = p_name_str;
\r
48 SYSTEM_INFO sysinfo;
\r
49 GetSystemInfo(&sysinfo);
\r
51 std::wstringstream s;
\r
53 s << cpu_name << L" Physical Threads: " << sysinfo.dwNumberOfProcessors;
\r
58 static std::wstring get_system_product_name()
\r
60 std::wstring system_product_name = L"Unknown System";
\r
62 DWORD dwType, dwSize;
\r
63 if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DESCRIPTION\\System\\BIOS"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
\r
65 wchar_t p_name_str[1024];
\r
68 dwSize = sizeof(p_name_str);
\r
70 if(RegQueryValueEx(hkey, TEXT("SystemProductName"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)
\r
71 system_product_name = p_name_str;
\r
76 return system_product_name;
\r