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

Unified Diff: chrome/browser/first_run/first_run_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
Index: chrome/browser/first_run/first_run_win.cc
===================================================================
--- chrome/browser/first_run/first_run_win.cc (revision 70414)
+++ chrome/browser/first_run/first_run_win.cc (working copy)
@@ -279,15 +279,18 @@
BrowserDistribution *dist = BrowserDistribution::GetDistribution();
base::win::RegKey key;
std::wstring rename_cmd;
- if (key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ) &&
- key.ReadValue(google_update::kRegRenameCmdField, &rename_cmd)) {
- base::ProcessHandle handle;
- if (base::LaunchApp(rename_cmd, true, true, &handle)) {
- DWORD exit_code;
- ::GetExitCodeProcess(handle, &exit_code);
- ::CloseHandle(handle);
- if (exit_code == installer::RENAME_SUCCESSFUL)
- return true;
+ LONG result = key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ);
+ if (result == ERROR_SUCCESS) {
+ result = key.ReadValue(google_update::kRegRenameCmdField, &rename_cmd);
+ if (result == ERROR_SUCCESS) {
+ base::ProcessHandle handle;
+ if (base::LaunchApp(rename_cmd, true, true, &handle)) {
+ DWORD exit_code;
+ ::GetExitCodeProcess(handle, &exit_code);
+ ::CloseHandle(handle);
+ if (exit_code == installer::RENAME_SUCCESSFUL)
+ return true;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698