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

Side by Side Diff: chrome/installer/util/advanced_firewall_manager_win.cc

Issue 2870263002: Rename ScopedComPtr::Receive to ScopedComPtr::GetAddressOf (Closed)
Patch Set: Rebase to 2a6f440 Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
22 22
23 bool AdvancedFirewallManager::Init(const base::string16& app_name, 23 bool AdvancedFirewallManager::Init(const base::string16& app_name,
24 const base::FilePath& app_path) { 24 const base::FilePath& app_path) {
25 firewall_rules_ = NULL; 25 firewall_rules_ = NULL;
26 HRESULT hr = firewall_policy_.CreateInstance(CLSID_NetFwPolicy2); 26 HRESULT hr = firewall_policy_.CreateInstance(CLSID_NetFwPolicy2);
27 if (FAILED(hr)) { 27 if (FAILED(hr)) {
28 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); 28 DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
29 firewall_policy_ = NULL; 29 firewall_policy_ = NULL;
30 return false; 30 return false;
31 } 31 }
32 hr = firewall_policy_->get_Rules(firewall_rules_.Receive()); 32 hr = firewall_policy_->get_Rules(firewall_rules_.GetAddressOf());
33 if (FAILED(hr)) { 33 if (FAILED(hr)) {
34 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); 34 DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
35 firewall_rules_ = NULL; 35 firewall_rules_ = NULL;
36 return false; 36 return false;
37 } 37 }
38 app_name_ = app_name; 38 app_name_ = app_name;
39 app_path_ = app_path; 39 app_path_ = app_path;
40 return true; 40 return true;
41 } 41 }
42 42
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 udp_rule->put_Grouping(base::win::ScopedBstr(app_name_.c_str())); 144 udp_rule->put_Grouping(base::win::ScopedBstr(app_name_.c_str()));
145 udp_rule->put_Profiles(NET_FW_PROFILE2_ALL); 145 udp_rule->put_Profiles(NET_FW_PROFILE2_ALL);
146 udp_rule->put_Action(NET_FW_ACTION_ALLOW); 146 udp_rule->put_Action(NET_FW_ACTION_ALLOW);
147 147
148 return udp_rule; 148 return udp_rule;
149 } 149 }
150 150
151 void AdvancedFirewallManager::GetAllRules( 151 void AdvancedFirewallManager::GetAllRules(
152 std::vector<base::win::ScopedComPtr<INetFwRule> >* rules) { 152 std::vector<base::win::ScopedComPtr<INetFwRule> >* rules) {
153 base::win::ScopedComPtr<IUnknown> rules_enum_unknown; 153 base::win::ScopedComPtr<IUnknown> rules_enum_unknown;
154 HRESULT hr = firewall_rules_->get__NewEnum(rules_enum_unknown.Receive()); 154 HRESULT hr = firewall_rules_->get__NewEnum(rules_enum_unknown.GetAddressOf());
155 if (FAILED(hr)) { 155 if (FAILED(hr)) {
156 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); 156 DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
157 return; 157 return;
158 } 158 }
159 159
160 base::win::ScopedComPtr<IEnumVARIANT> rules_enum; 160 base::win::ScopedComPtr<IEnumVARIANT> rules_enum;
161 hr = rules_enum.QueryFrom(rules_enum_unknown.Get()); 161 hr = rules_enum.QueryFrom(rules_enum_unknown.Get());
162 if (FAILED(hr)) { 162 if (FAILED(hr)) {
163 DLOG(ERROR) << logging::SystemErrorCodeToString(hr); 163 DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
164 return; 164 return;
(...skipping 28 matching lines...) Expand all
193 !base::FilePath::CompareEqualIgnoreCase(static_cast<BSTR>(path), 193 !base::FilePath::CompareEqualIgnoreCase(static_cast<BSTR>(path),
194 app_path_.value())) { 194 app_path_.value())) {
195 continue; 195 continue;
196 } 196 }
197 197
198 rules->push_back(rule); 198 rules->push_back(rule);
199 } 199 }
200 } 200 }
201 201
202 } // namespace installer 202 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/browser/win/settings_app_monitor.cc ('k') | chrome/installer/util/legacy_firewall_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698