Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginSettings.cpp

Issue 6237450183639040: Issue 1283 - wrong usage of memset, fix sizeof, make proper initializing (Closed)
Patch Set: Created Sept. 1, 2014, 11:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include <Wbemidl.h> 3 #include <Wbemidl.h>
4 #include <time.h> 4 #include <time.h>
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 #include "PluginClient.h" 6 #include "PluginClient.h"
7 #include "PluginSystem.h" 7 #include "PluginSystem.h"
8 #ifdef SUPPORT_FILTER 8 #ifdef SUPPORT_FILTER
9 #include "PluginFilter.h" 9 #include "PluginFilter.h"
10 #endif 10 #endif
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 ReadWhitelist(true); 243 ReadWhitelist(true);
244 } 244 }
245 245
246 return true; 246 return true;
247 } 247 }
248 248
249 DWORD CPluginSettings::GetWindowsBuildNumber() 249 DWORD CPluginSettings::GetWindowsBuildNumber()
250 { 250 {
251 if (m_WindowsBuildNumber == 0) 251 if (m_WindowsBuildNumber == 0)
252 { 252 {
253 OSVERSIONINFOEX osvi; 253 SYSTEM_INFO si = {};
254 SYSTEM_INFO si;
255 BOOL bOsVersionInfoEx; 254 BOOL bOsVersionInfoEx;
256 255
257 ZeroMemory(&si, sizeof(SYSTEM_INFO)); 256 OSVERSIONINFOEX osvi = {};
258 ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); 257 osvi.dwOSVersionInfoSize = sizeof(osvi);
259 258 bOsVersionInfoEx = GetVersionExW(reinterpret_cast<OSVERSIONINFO*>(&osvi));
260 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
261 bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO*) &osvi);
262 259
263 m_WindowsBuildNumber = osvi.dwBuildNumber; 260 m_WindowsBuildNumber = osvi.dwBuildNumber;
264 } 261 }
265 262
266 return m_WindowsBuildNumber; 263 return m_WindowsBuildNumber;
267 } 264 }
268 265
269 void CPluginSettings::SetSubscription(const std::wstring& url) 266 void CPluginSettings::SetSubscription(const std::wstring& url)
270 { 267 {
271 CPluginClient::GetInstance()->SetSubscription(url); 268 CPluginClient::GetInstance()->SetSubscription(url);
(...skipping 21 matching lines...) Expand all
293 } 290 }
294 291
295 CString CPluginSettings::GetDocumentationLink() 292 CString CPluginSettings::GetDocumentationLink()
296 { 293 {
297 return CString(CPluginClient::GetInstance()->GetDocumentationLink().c_str()); 294 return CString(CPluginClient::GetInstance()->GetDocumentationLink().c_str());
298 } 295 }
299 296
300 297
301 298
302 #endif // SUPPORT_WHITELIST 299 #endif // SUPPORT_WHITELIST
OLDNEW

Powered by Google App Engine
This is Rietveld