Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: chrome/browser/enumerate_modules_model_win.cc

Issue 616173003: Allow Registry Iterator functions to use a specified WOW64 mode when iterating. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 enumerated_modules_->push_back(entry); 521 enumerated_modules_->push_back(entry);
522 } while (::Module32Next(snap.Get(), &module)); 522 } while (::Module32Next(snap.Get(), &module));
523 } 523 }
524 524
525 void ModuleEnumerator::EnumerateShellExtensions() { 525 void ModuleEnumerator::EnumerateShellExtensions() {
526 ReadShellExtensions(HKEY_LOCAL_MACHINE); 526 ReadShellExtensions(HKEY_LOCAL_MACHINE);
527 ReadShellExtensions(HKEY_CURRENT_USER); 527 ReadShellExtensions(HKEY_CURRENT_USER);
528 } 528 }
529 529
530 void ModuleEnumerator::ReadShellExtensions(HKEY parent) { 530 void ModuleEnumerator::ReadShellExtensions(HKEY parent) {
531 base::win::RegistryValueIterator registration(parent, kRegPath); 531 base::win::RegistryValueIterator registration(parent, kRegPath, 0);
532 while (registration.Valid()) { 532 while (registration.Valid()) {
533 std::wstring key(std::wstring(L"CLSID\\") + registration.Name() + 533 std::wstring key(std::wstring(L"CLSID\\") + registration.Name() +
534 L"\\InProcServer32"); 534 L"\\InProcServer32");
535 base::win::RegKey clsid; 535 base::win::RegKey clsid;
536 if (clsid.Open(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ) != ERROR_SUCCESS) { 536 if (clsid.Open(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ) != ERROR_SUCCESS) {
537 ++registration; 537 ++registration;
538 continue; 538 continue;
539 } 539 }
540 base::string16 dll; 540 base::string16 dll;
541 if (clsid.ReadValue(L"", &dll) != ERROR_SUCCESS) { 541 if (clsid.ReadValue(L"", &dll) != ERROR_SUCCESS) {
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 GenerateHash(base::WideToUTF8(module.location), &location); 1036 GenerateHash(base::WideToUTF8(module.location), &location);
1037 GenerateHash(base::WideToUTF8(module.description), &description); 1037 GenerateHash(base::WideToUTF8(module.description), &description);
1038 GenerateHash(base::WideToUTF8(module.digital_signer), &signer); 1038 GenerateHash(base::WideToUTF8(module.digital_signer), &signer);
1039 1039
1040 base::string16 url = 1040 base::string16 url =
1041 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, 1041 l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS,
1042 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location), 1042 base::ASCIIToUTF16(filename), base::ASCIIToUTF16(location),
1043 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer)); 1043 base::ASCIIToUTF16(description), base::ASCIIToUTF16(signer));
1044 return GURL(base::UTF16ToUTF8(url)); 1044 return GURL(base::UTF16ToUTF8(url));
1045 } 1045 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698