OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/enumerate_modules_model_win.h" | 5 #include "chrome/browser/enumerate_modules_model_win.h" |
6 | 6 |
7 #include <Tlhelp32.h> | 7 #include <Tlhelp32.h> |
8 #include <wintrust.h> | 8 #include <wintrust.h> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 ReadShellExtensions(HKEY_LOCAL_MACHINE); | 398 ReadShellExtensions(HKEY_LOCAL_MACHINE); |
399 ReadShellExtensions(HKEY_CURRENT_USER); | 399 ReadShellExtensions(HKEY_CURRENT_USER); |
400 } | 400 } |
401 | 401 |
402 void ModuleEnumerator::ReadShellExtensions(HKEY parent) { | 402 void ModuleEnumerator::ReadShellExtensions(HKEY parent) { |
403 base::win::RegistryValueIterator registration(parent, kRegPath); | 403 base::win::RegistryValueIterator registration(parent, kRegPath); |
404 while (registration.Valid()) { | 404 while (registration.Valid()) { |
405 std::wstring key(std::wstring(L"CLSID\\") + registration.Name() + | 405 std::wstring key(std::wstring(L"CLSID\\") + registration.Name() + |
406 L"\\InProcServer32"); | 406 L"\\InProcServer32"); |
407 base::win::RegKey clsid; | 407 base::win::RegKey clsid; |
408 if (!clsid.Open(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ)) { | 408 if (clsid.Open(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ) != ERROR_SUCCESS) { |
409 ++registration; | 409 ++registration; |
410 continue; | 410 continue; |
411 } | 411 } |
412 string16 dll; | 412 string16 dll; |
413 if (!clsid.ReadValue(L"", &dll)) { | 413 if (clsid.ReadValue(L"", &dll) != ERROR_SUCCESS) { |
414 ++registration; | 414 ++registration; |
415 continue; | 415 continue; |
416 } | 416 } |
417 clsid.Close(); | 417 clsid.Close(); |
418 | 418 |
419 Module entry; | 419 Module entry; |
420 entry.type = SHELL_EXTENSION; | 420 entry.type = SHELL_EXTENSION; |
421 entry.location = dll; | 421 entry.location = dll; |
422 PopulateModuleInformation(&entry); | 422 PopulateModuleInformation(&entry); |
423 | 423 |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 GenerateHash(WideToUTF8(module.name), &filename); | 843 GenerateHash(WideToUTF8(module.name), &filename); |
844 GenerateHash(WideToUTF8(module.location), &location); | 844 GenerateHash(WideToUTF8(module.location), &location); |
845 GenerateHash(WideToUTF8(module.description), &description); | 845 GenerateHash(WideToUTF8(module.description), &description); |
846 GenerateHash(WideToUTF8(module.digital_signer), &signer); | 846 GenerateHash(WideToUTF8(module.digital_signer), &signer); |
847 | 847 |
848 string16 url = l10n_util::GetStringF(IDS_HELP_CENTER_VIEW_CONFLICTS, | 848 string16 url = l10n_util::GetStringF(IDS_HELP_CENTER_VIEW_CONFLICTS, |
849 ASCIIToWide(filename), ASCIIToWide(location), | 849 ASCIIToWide(filename), ASCIIToWide(location), |
850 ASCIIToWide(description), ASCIIToWide(signer)); | 850 ASCIIToWide(description), ASCIIToWide(signer)); |
851 return GURL(WideToUTF8(url)); | 851 return GURL(WideToUTF8(url)); |
852 } | 852 } |
OLD | NEW |