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

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

Issue 6090006: Regkey functions return error code instead of bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 ReadShellExtensions(HKEY_LOCAL_MACHINE); 416 ReadShellExtensions(HKEY_LOCAL_MACHINE);
417 ReadShellExtensions(HKEY_CURRENT_USER); 417 ReadShellExtensions(HKEY_CURRENT_USER);
418 } 418 }
419 419
420 void ModuleEnumerator::ReadShellExtensions(HKEY parent) { 420 void ModuleEnumerator::ReadShellExtensions(HKEY parent) {
421 base::win::RegistryValueIterator registration(parent, kRegPath); 421 base::win::RegistryValueIterator registration(parent, kRegPath);
422 while (registration.Valid()) { 422 while (registration.Valid()) {
423 std::wstring key(std::wstring(L"CLSID\\") + registration.Name() + 423 std::wstring key(std::wstring(L"CLSID\\") + registration.Name() +
424 L"\\InProcServer32"); 424 L"\\InProcServer32");
425 base::win::RegKey clsid; 425 base::win::RegKey clsid;
426 if (!clsid.Open(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ)) { 426 if (clsid.Open(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ) != ERROR_SUCCESS) {
427 ++registration; 427 ++registration;
428 continue; 428 continue;
429 } 429 }
430 string16 dll; 430 string16 dll;
431 if (!clsid.ReadValue(L"", &dll)) { 431 if (clsid.ReadValue(L"", &dll) != ERROR_SUCCESS) {
432 ++registration; 432 ++registration;
433 continue; 433 continue;
434 } 434 }
435 clsid.Close(); 435 clsid.Close();
436 436
437 Module entry; 437 Module entry;
438 entry.type = SHELL_EXTENSION; 438 entry.type = SHELL_EXTENSION;
439 entry.location = dll; 439 entry.location = dll;
440 PopulateModuleInformation(&entry); 440 PopulateModuleInformation(&entry);
441 441
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 GenerateHash(WideToUTF8(module.name), &filename); 879 GenerateHash(WideToUTF8(module.name), &filename);
880 GenerateHash(WideToUTF8(module.location), &location); 880 GenerateHash(WideToUTF8(module.location), &location);
881 GenerateHash(WideToUTF8(module.description), &description); 881 GenerateHash(WideToUTF8(module.description), &description);
882 GenerateHash(WideToUTF8(module.digital_signer), &signer); 882 GenerateHash(WideToUTF8(module.digital_signer), &signer);
883 883
884 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, 884 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS,
885 ASCIIToUTF16(filename), ASCIIToUTF16(location), 885 ASCIIToUTF16(filename), ASCIIToUTF16(location),
886 ASCIIToUTF16(description), ASCIIToUTF16(signer)); 886 ASCIIToUTF16(description), ASCIIToUTF16(signer));
887 return GURL(UTF16ToUTF8(url)); 887 return GURL(UTF16ToUTF8(url));
888 } 888 }
OLDNEW
« no previous file with comments | « chrome/browser/background_mode_manager_win.cc ('k') | chrome/browser/extensions/extension_rlz_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698