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

Unified Diff: chrome/browser/autofill/autofill_ie_toolbar_import_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/browser/autofill/autofill_ie_toolbar_import_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_ie_toolbar_import_win.cc
===================================================================
--- chrome/browser/autofill/autofill_ie_toolbar_import_win.cc (revision 71761)
+++ chrome/browser/autofill/autofill_ie_toolbar_import_win.cc (working copy)
@@ -57,12 +57,13 @@
string16 ReadAndDecryptValue(RegKey* key, const wchar_t* value_name) {
DWORD data_type = REG_BINARY;
DWORD data_size = 0;
- if (!key->ReadValue(value_name, NULL, &data_size, &data_type) ||
- !data_size || data_type != REG_BINARY)
+ LONG result = key->ReadValue(value_name, NULL, &data_size, &data_type);
+ if ((result != ERROR_SUCCESS) || !data_size || data_type != REG_BINARY)
return string16();
std::vector<uint8> data;
data.resize(data_size);
- if (key->ReadValue(value_name, &(data[0]), &data_size, &data_type)) {
+ result = key->ReadValue(value_name, &(data[0]), &data_size, &data_type);
+ if (result == ERROR_SUCCESS) {
std::string out_data;
if (DecryptData(data, &out_data)) {
// The actual data is in UTF16 already.
@@ -125,7 +126,7 @@
for (uint32 value_index = 0; value_index < key->ValueCount(); ++value_index) {
std::wstring value_name;
- if (!key->ReadName(value_index, &value_name))
+ if (key->ReadName(value_index, &value_name) != ERROR_SUCCESS)
continue;
RegToFieldMap::const_iterator it = reg_to_field.find(value_name);
if (it == reg_to_field.end())
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/browser/autofill/autofill_ie_toolbar_import_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698