| OLD | NEW |
| 1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
| 2 | 2 |
| 3 // Internet / FTP | 3 // Internet / FTP |
| 4 #include <wininet.h> | 4 #include <wininet.h> |
| 5 | 5 |
| 6 // IP adapter | 6 // IP adapter |
| 7 #include <iphlpapi.h> | 7 #include <iphlpapi.h> |
| 8 | 8 |
| 9 #include "PluginSystem.h" | 9 #include "PluginSystem.h" |
| 10 #include "PluginClient.h" | 10 #include "PluginClient.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 { | 87 { |
| 88 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO
_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country"); | 88 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO
_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country"); |
| 89 } | 89 } |
| 90 else | 90 else |
| 91 { | 91 { |
| 92 lang.Append(country); | 92 lang.Append(country); |
| 93 } | 93 } |
| 94 | 94 |
| 95 return lang; | 95 return lang; |
| 96 } | 96 } |
| 97 | |
| 98 | |
| 99 CString CPluginSystem::GetBrowserVersion() const | |
| 100 { | |
| 101 CString browserVersion; | |
| 102 | |
| 103 HKEY hKey; | |
| 104 DWORD res; | |
| 105 | |
| 106 // Open the handler | |
| 107 if ((res = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Internet
Explorer", 0, KEY_QUERY_VALUE, &hKey)) == ERROR_SUCCESS) | |
| 108 { | |
| 109 TCHAR buf[255]; | |
| 110 DWORD dwBufSize = sizeof(buf); | |
| 111 DWORD dwType = REG_SZ; | |
| 112 | |
| 113 // Do the processing, find the version | |
| 114 if ((res = ::RegQueryValueEx(hKey, L"Version", 0, &dwType, (BYTE*)buf, &dwBu
fSize)) == ERROR_SUCCESS) | |
| 115 { | |
| 116 browserVersion = buf; | |
| 117 int pos = 0; | |
| 118 if ((pos = browserVersion.Find('.')) >= 0) | |
| 119 { | |
| 120 browserVersion = browserVersion.Left(pos); | |
| 121 } | |
| 122 } | |
| 123 else | |
| 124 { | |
| 125 DEBUG_ERROR_LOG(res, PLUGIN_ERROR_OS_VERSION, PLUGIN_ERROR_OS_VERSION_REG_
QUERY_VALUE, L"Client::GetBrowserVer - Failed reg query value"); | |
| 126 } | |
| 127 | |
| 128 // Close the handler | |
| 129 ::RegCloseKey(hKey); | |
| 130 } | |
| 131 else | |
| 132 { | |
| 133 DEBUG_ERROR_LOG(res, PLUGIN_ERROR_OS_VERSION, PLUGIN_ERROR_OS_VERSION_REG_OP
EN_KEY, L"Client::GetBrowserVer - Failed reg open"); | |
| 134 } | |
| 135 | |
| 136 return browserVersion; | |
| 137 } | |
| OLD | NEW |