OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/installer/util/delete_reg_key_work_item.h" | 5 #include "chrome/installer/util/delete_reg_key_work_item.h" |
6 | 6 |
7 #include <shlwapi.h> | 7 #include <shlwapi.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
11 | 11 |
12 using base::win::RegKey; | 12 using base::win::RegKey; |
13 | 13 |
14 DeleteRegKeyWorkItem::~DeleteRegKeyWorkItem() { | 14 DeleteRegKeyWorkItem::~DeleteRegKeyWorkItem() { |
15 } | 15 } |
16 | 16 |
17 DeleteRegKeyWorkItem::DeleteRegKeyWorkItem(HKEY predefined_root, | 17 DeleteRegKeyWorkItem::DeleteRegKeyWorkItem(HKEY predefined_root, |
18 const std::wstring& path) | 18 const std::wstring& path, |
| 19 RegWow64ViewOption reg_wow64_option) |
19 : predefined_root_(predefined_root), | 20 : predefined_root_(predefined_root), |
20 path_(path) { | 21 path_(path), |
| 22 reg_wow64_option_(reg_wow64_option) { |
21 DCHECK(predefined_root); | 23 DCHECK(predefined_root); |
22 // It's a safe bet that we don't want to delete one of the root trees. | 24 // It's a safe bet that we don't want to delete one of the root trees. |
23 DCHECK(!path.empty()); | 25 DCHECK(!path.empty()); |
24 } | 26 } |
25 | 27 |
26 bool DeleteRegKeyWorkItem::Do() { | 28 bool DeleteRegKeyWorkItem::Do() { |
27 if (path_.empty()) | 29 if (path_.empty()) |
28 return false; | 30 return false; |
29 | 31 |
30 RegistryKeyBackup backup; | 32 RegistryKeyBackup backup; |
(...skipping 30 matching lines...) Expand all Loading... |
61 if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) { | 63 if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) { |
62 LOG(ERROR) << "Failed to delete key at " << path_ << " in rollback, " | 64 LOG(ERROR) << "Failed to delete key at " << path_ << " in rollback, " |
63 "result: " << result; | 65 "result: " << result; |
64 } | 66 } |
65 | 67 |
66 // Restore the old contents. The restoration takes on its default security | 68 // Restore the old contents. The restoration takes on its default security |
67 // attributes; any custom attributes are lost. | 69 // attributes; any custom attributes are lost. |
68 if (!backup_.WriteTo(predefined_root_, path_.c_str())) | 70 if (!backup_.WriteTo(predefined_root_, path_.c_str())) |
69 LOG(ERROR) << "Failed to restore key in rollback."; | 71 LOG(ERROR) << "Failed to restore key in rollback."; |
70 } | 72 } |
OLD | NEW |