| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/advanced_firewall_manager_win.h" | 5 #include "chrome/installer/util/advanced_firewall_manager_win.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 hr = rules_enum->Next(1, rule_var.Receive(), NULL); | 166 hr = rules_enum->Next(1, rule_var.Receive(), NULL); |
| 167 DLOG_IF(ERROR, FAILED(hr)) << logging::SystemErrorCodeToString(hr); | 167 DLOG_IF(ERROR, FAILED(hr)) << logging::SystemErrorCodeToString(hr); |
| 168 if (hr != S_OK) | 168 if (hr != S_OK) |
| 169 break; | 169 break; |
| 170 DCHECK_EQ(VT_DISPATCH, rule_var.type()); | 170 DCHECK_EQ(VT_DISPATCH, rule_var.type()); |
| 171 if (VT_DISPATCH != rule_var.type()) { | 171 if (VT_DISPATCH != rule_var.type()) { |
| 172 DLOG(ERROR) << "Unexpected type"; | 172 DLOG(ERROR) << "Unexpected type"; |
| 173 continue; | 173 continue; |
| 174 } | 174 } |
| 175 base::win::ScopedComPtr<INetFwRule> rule; | 175 base::win::ScopedComPtr<INetFwRule> rule; |
| 176 hr = rule.QueryFrom(V_DISPATCH(&rule_var)); | 176 hr = rule.QueryFrom(V_DISPATCH(rule_var.ptr())); |
| 177 if (FAILED(hr)) { | 177 if (FAILED(hr)) { |
| 178 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); | 178 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); |
| 179 continue; | 179 continue; |
| 180 } | 180 } |
| 181 | 181 |
| 182 base::win::ScopedBstr path; | 182 base::win::ScopedBstr path; |
| 183 hr = rule->get_ApplicationName(path.Receive()); | 183 hr = rule->get_ApplicationName(path.Receive()); |
| 184 if (FAILED(hr)) { | 184 if (FAILED(hr)) { |
| 185 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); | 185 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); |
| 186 continue; | 186 continue; |
| 187 } | 187 } |
| 188 | 188 |
| 189 if (!path || | 189 if (!path || |
| 190 !base::FilePath::CompareEqualIgnoreCase(static_cast<BSTR>(path), | 190 !base::FilePath::CompareEqualIgnoreCase(static_cast<BSTR>(path), |
| 191 app_path_.value())) { | 191 app_path_.value())) { |
| 192 continue; | 192 continue; |
| 193 } | 193 } |
| 194 | 194 |
| 195 rules->push_back(rule); | 195 rules->push_back(rule); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace installer | 199 } // namespace installer |
| OLD | NEW |