Chromium Code Reviews| Index: base/win/win_util.cc |
| =================================================================== |
| --- base/win/win_util.cc (revision 71561) |
| +++ base/win/win_util.cc (working copy) |
| @@ -93,7 +93,7 @@ |
| L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", |
| KEY_READ); |
| DWORD uac_enabled; |
| - if (!key.ReadValueDW(L"EnableLUA", &uac_enabled)) |
| + if (key.ReadValueDW(L"EnableLUA", &uac_enabled) != ERROR_SUCCESS) |
| return true; |
| // Users can set the EnableLUA value to something arbitrary, like 2, which |
| // Vista will treat as UAC enabled, so we make sure it is not set to 0. |
| @@ -128,12 +128,13 @@ |
| bool AddCommandToAutoRun(HKEY root_key, const string16& name, |
| const string16& command) { |
| base::win::RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE); |
| - return autorun_key.WriteValue(name.c_str(), command.c_str()); |
| + return (autorun_key.WriteValue(name.c_str(), command.c_str()) |
| + == ERROR_SUCCESS); |
|
grt (UTC plus 2)
2011/01/16 04:19:48
nit: Chrome style guide says to wrap after the ope
amit
2011/01/16 07:54:28
Done.
|
| } |
| bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name) { |
| base::win::RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE); |
| - return autorun_key.DeleteValue(name.c_str()); |
| + return (autorun_key.DeleteValue(name.c_str()) == ERROR_SUCCESS); |
| } |
| } // namespace win |