| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 system = s_instance; | 55 system = s_instance; |
| 56 } | 56 } |
| 57 s_criticalSection.Unlock(); | 57 s_criticalSection.Unlock(); |
| 58 | 58 |
| 59 return system; | 59 return system; |
| 60 } | 60 } |
| 61 | 61 |
| 62 CString CPluginSystem::GetBrowserLanguage() const | 62 CString CPluginSystem::GetBrowserLanguage() const |
| 63 { | 63 { |
| 64 CString browserLanguage; | |
| 65 | |
| 66 LANGID lcid = ::GetUserDefaultLangID(); | 64 LANGID lcid = ::GetUserDefaultLangID(); |
| 67 TCHAR language[128]; | 65 TCHAR language[128]; |
| 68 memset(language, 0, sizeof(language)); | 66 memset(language, 0, sizeof(language)); |
| 69 | 67 |
| 68 TCHAR country[128]; |
| 69 memset(language, 0, sizeof(country)); |
| 70 |
| 71 CString lang; |
| 72 |
| 70 int res = ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, language, 127); | 73 int res = ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, language, 127); |
| 71 if (res == 0) | 74 if (res == 0) |
| 72 { | 75 { |
| 73 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_E
RROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - Failed"); | 76 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_E
RROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - Failed"); |
| 74 } | 77 } |
| 75 else | 78 else |
| 76 { | 79 { |
| 77 » » browserLanguage = language; | 80 » » lang.Append(language); |
| 78 } | 81 } |
| 79 | 82 |
| 80 » return browserLanguage; | 83 » lang.Append(L"-"); |
| 84 |
| 85 |
| 86 » res = ::GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, country, 127); |
| 87 » if (res == 0) |
| 88 » { |
| 89 » » DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_E
RROR_SYSINFO_BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve coun
try"); |
| 90 » } |
| 91 » else |
| 92 » { |
| 93 » » lang.Append(country); |
| 94 » } |
| 95 |
| 96 » return lang; |
| 81 } | 97 } |
| 82 | 98 |
| 83 | 99 |
| 84 CString CPluginSystem::GetBrowserVersion() const | 100 CString CPluginSystem::GetBrowserVersion() const |
| 85 { | 101 { |
| 86 CString browserVersion; | 102 CString browserVersion; |
| 87 | 103 |
| 88 HKEY hKey; | 104 HKEY hKey; |
| 89 DWORD res; | 105 DWORD res; |
| 90 | 106 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 113 // Close the handler | 129 // Close the handler |
| 114 ::RegCloseKey(hKey); | 130 ::RegCloseKey(hKey); |
| 115 } | 131 } |
| 116 else | 132 else |
| 117 { | 133 { |
| 118 DEBUG_ERROR_LOG(res, PLUGIN_ERROR_OS_VERSION, PLUGIN_ERROR_OS_VE
RSION_REG_OPEN_KEY, L"Client::GetBrowserVer - Failed reg open"); | 134 DEBUG_ERROR_LOG(res, PLUGIN_ERROR_OS_VERSION, PLUGIN_ERROR_OS_VE
RSION_REG_OPEN_KEY, L"Client::GetBrowserVer - Failed reg open"); |
| 119 } | 135 } |
| 120 | 136 |
| 121 return browserVersion; | 137 return browserVersion; |
| 122 } | 138 } |
| OLD | NEW |