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

Unified Diff: chrome/installer/util/shell_util.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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/shell_util.cc
===================================================================
--- chrome/installer/util/shell_util.cc (revision 71345)
+++ chrome/installer/util/shell_util.cc (working copy)
@@ -200,13 +200,13 @@
bool found = false;
if (_is_string) {
std::wstring read_value;
- found = (key.ReadValue(_name.c_str(), &read_value)) &&
+ found = (key.ReadValue(_name.c_str(), &read_value) == ERROR_SUCCESS) &&
(read_value.size() == _value.size()) &&
(std::equal(_value.begin(), _value.end(), read_value.begin(),
base::CaseInsensitiveCompare<wchar_t>()));
} else {
DWORD read_value;
- found = key.ReadValueDW(_name.c_str(), &read_value) &&
+ found = (key.ReadValueDW(_name.c_str(), &read_value) == ERROR_SUCCESS) &&
read_value == _int_value;
grt (UTC plus 2) 2011/01/14 15:53:43 For consistency, this should have parens, no?
amit 2011/01/15 01:28:11 Done.
}
key.Close();
@@ -220,10 +220,10 @@
bool found = false;
if (_is_string) {
std::wstring read_value;
- found = key.ReadValue(_name.c_str(), &read_value);
+ found = key.ReadValue(_name.c_str(), &read_value) == ERROR_SUCCESS;
} else {
DWORD read_value;
- found = key.ReadValueDW(_name.c_str(), &read_value);
+ found = key.ReadValueDW(_name.c_str(), &read_value) == ERROR_SUCCESS;
}
key.Close();
return found;
@@ -356,7 +356,7 @@
reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen);
RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ);
std::wstring registry_chrome_exe;
- if (!key.ReadValue(L"", &registry_chrome_exe) ||
+ if ((key.ReadValue(L"", &registry_chrome_exe) != ERROR_SUCCESS) ||
registry_chrome_exe.length() < 2)
return false;
@@ -583,15 +583,16 @@
RegKey capabilities(root, (key + L"\\Capabilities").c_str(), KEY_READ);
std::wstring name;
if (!capabilities.Valid() ||
- !capabilities.ReadValue(L"ApplicationName", &name)) {
+ capabilities.ReadValue(L"ApplicationName", &name) != ERROR_SUCCESS) {
RegKey base_key(root, key.c_str(), KEY_READ);
- if (!base_key.ReadValue(L"", &name))
+ if (base_key.ReadValue(L"", &name) != ERROR_SUCCESS)
continue;
}
RegKey install_info(root, (key + L"\\InstallInfo").c_str(), KEY_READ);
std::wstring command;
if (!install_info.Valid() ||
- !install_info.ReadValue(L"ReinstallCommand", &command))
+ (install_info.ReadValue(L"ReinstallCommand",
+ &command) != ERROR_SUCCESS))
continue;
if (!name.empty() && !command.empty() &&
name.find(dist->GetApplicationName()) == std::wstring::npos)

Powered by Google App Engine
This is Rietveld 408576698