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

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

Issue 5171515343503360: Issue #41 - Bring method of determining IE version up to date (Closed)
Patch Set: Final (?) 2 Created Jan. 5, 2015, 1:02 p.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 #include "PluginSettings.h" 2 #include "PluginSettings.h"
3 #include "PluginSystem.h" 3 #include "PluginSystem.h"
4 #include "PluginFilter.h" 4 #include "PluginFilter.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #include "PluginMutex.h" 6 #include "PluginMutex.h"
7 #include "PluginClass.h" 7 #include "PluginClass.h"
8 8
9 #include "AdblockPlusClient.h" 9 #include "AdblockPlusClient.h"
10 10
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 Communication::InputBuffer response; 281 Communication::InputBuffer response;
282 if (!CallEngine(request, response)) 282 if (!CallEngine(request, response))
283 return false; 283 return false;
284 284
285 bool isWhitelisted; 285 bool isWhitelisted;
286 response >> isWhitelisted; 286 response >> isWhitelisted;
287 return isWhitelisted; 287 return isWhitelisted;
288 } 288 }
289 289
290 int CAdblockPlusClient::GetIEVersion()
291 {
292 //HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer
293 HKEY hKey;
294 LSTATUS status = RegOpenKey(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Interne t Explorer", &hKey);
295 if (status != 0)
296 {
297 return 0;
298 }
299 DWORD type, cbData;
300 BYTE version[50];
301 cbData = 50;
302 status = RegQueryValueEx(hKey, L"Version", NULL, &type, (BYTE*)version, &cbDat a);
303 if (status != 0)
304 {
305 return 0;
306 }
307 RegCloseKey(hKey);
308 return (int)(version[0] - 48);
309 }
310
311 bool CAdblockPlusClient::Matches(const std::wstring& url, const std::wstring& co ntentType, const std::wstring& domain) 290 bool CAdblockPlusClient::Matches(const std::wstring& url, const std::wstring& co ntentType, const std::wstring& domain)
312 { 291 {
313 Communication::OutputBuffer request; 292 Communication::OutputBuffer request;
314 request << Communication::PROC_MATCHES << ToUtf8String(url) << ToUtf8String(co ntentType) << ToUtf8String(domain); 293 request << Communication::PROC_MATCHES << ToUtf8String(url) << ToUtf8String(co ntentType) << ToUtf8String(domain);
315 294
316 Communication::InputBuffer response; 295 Communication::InputBuffer response;
317 if (!CallEngine(request, response)) 296 if (!CallEngine(request, response))
318 return false; 297 return false;
319 298
320 bool match; 299 bool match;
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 DEBUG_GENERAL("CompareVersions"); 549 DEBUG_GENERAL("CompareVersions");
571 Communication::OutputBuffer request; 550 Communication::OutputBuffer request;
572 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S tring(v2); 551 request << Communication::PROC_COMPARE_VERSIONS << ToUtf8String(v1) << ToUtf8S tring(v2);
573 Communication::InputBuffer response; 552 Communication::InputBuffer response;
574 if (!CallEngine(request, response)) 553 if (!CallEngine(request, response))
575 return 0; 554 return 0;
576 int result; 555 int result;
577 response >> result; 556 response >> result;
578 return result; 557 return result;
579 } 558 }
OLDNEW

Powered by Google App Engine
This is Rietveld