]> git.sesse.net Git - casparcg/commitdiff
* Moved functions from windows/current_version.h to windows/system_info.cpp and remov...
authorHelge Norberg <helge.norberg@svt.se>
Thu, 5 Nov 2015 11:12:23 +0000 (12:12 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Thu, 5 Nov 2015 11:12:23 +0000 (12:12 +0100)
common/CMakeLists.txt
common/os/windows/current_version.h [deleted file]
common/os/windows/system_info.cpp

index 0c91e057f424ed458c767ad9b8aac68cfdc542d4..755f28b482e498a7fef553600bdb0db297d1345b 100644 (file)
@@ -23,7 +23,6 @@ if (MSVC)
                        compiler/vs/StackWalker.cpp
                        compiler/vs/StackWalker.h
 
-                       os/windows/current_version.h
                        os/windows/filesystem.cpp
                        os/windows/page_locked_allocator.cpp
                        os/windows/prec_timer.cpp
diff --git a/common/os/windows/current_version.h b/common/os/windows/current_version.h
deleted file mode 100644 (file)
index 14d3d6d..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
-*
-* This file is part of CasparCG (www.casparcg.com).
-*
-* CasparCG is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, either version 3 of the License, or
-* (at your option) any later version.
-*
-* CasparCG is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
-*
-* Author: Robert Nagy, ronag89@gmail.com
-*/
-
-#pragma once
-
-#define NOMINMAX
-#define WIN32_LEAN_AND_MEAN
-
-#include "windows.h"
-
-#include <string>
-
-namespace caspar {
-
-static std::wstring win_product_name()
-{
-       std::wstring result = L"Unknown Windows Product Name.";
-       HKEY hkey; 
-       DWORD dwType, dwSize;
-       if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
-       {
-               wchar_t p_name_str[1024];
-
-               dwType = REG_SZ;
-               dwSize = sizeof(p_name_str);
-
-               if(RegQueryValueEx(hkey, TEXT("ProductName"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)             
-                       result = p_name_str;            
-                
-               RegCloseKey(hkey);
-       }
-       return result;
-}
-
-static std::wstring win_sp_version()
-{
-       std::wstring result =  L"";
-       HKEY hkey; 
-       DWORD dwType, dwSize;
-       if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
-       {
-               wchar_t csd_ver_str[1024];
-
-               dwType = REG_SZ;
-               dwSize = sizeof(csd_ver_str);
-
-               if(RegQueryValueEx(hkey, TEXT("CSDVersion"), NULL, &dwType, (PBYTE)&csd_ver_str, &dwSize) == ERROR_SUCCESS)             
-                       result = csd_ver_str;
-                
-               RegCloseKey(hkey);
-       }
-       return result;
-}
-
-}
\ No newline at end of file
index f1b6bd067c164092c0ab3a64226ee4071e2a5332..772d873f6ebbbe205d2aa85e6d4a4e52c503af8d 100644 (file)
@@ -22,7 +22,6 @@
 #include "../../stdafx.h"
 
 #include "../system_info.h"
-#include "current_version.h"
 
 #include "windows.h"
 
@@ -81,6 +80,46 @@ std::wstring system_product_name()
        return system_product_name;
 }
 
+std::wstring win_product_name()
+{
+       std::wstring result = L"Unknown Windows Product Name.";
+       HKEY hkey;
+       DWORD dwType, dwSize;
+       if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
+       {
+               wchar_t p_name_str[1024];
+
+               dwType = REG_SZ;
+               dwSize = sizeof(p_name_str);
+
+               if (RegQueryValueEx(hkey, TEXT("ProductName"), NULL, &dwType, (PBYTE)&p_name_str, &dwSize) == ERROR_SUCCESS)
+                       result = p_name_str;
+
+               RegCloseKey(hkey);
+       }
+       return result;
+}
+
+std::wstring win_sp_version()
+{
+       std::wstring result = L"";
+       HKEY hkey;
+       DWORD dwType, dwSize;
+       if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS)
+       {
+               wchar_t csd_ver_str[1024];
+
+               dwType = REG_SZ;
+               dwSize = sizeof(csd_ver_str);
+
+               if (RegQueryValueEx(hkey, TEXT("CSDVersion"), NULL, &dwType, (PBYTE)&csd_ver_str, &dwSize) == ERROR_SUCCESS)
+                       result = csd_ver_str;
+
+               RegCloseKey(hkey);
+       }
+       return result;
+}
+
 std::wstring os_description()
 {
        return win_product_name() + L" " + win_sp_version();