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

Unified Diff: chrome/installer/util/advanced_firewall_manager_win.cc

Issue 2894483002: Migrate from ScopedComPtr::CreateInstance() to CoCreateInstance in chrome/... (Closed)
Patch Set: Fix Header Include Location 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/gcapi/gcapi.cc ('k') | chrome/installer/util/legacy_firewall_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/advanced_firewall_manager_win.cc
diff --git a/chrome/installer/util/advanced_firewall_manager_win.cc b/chrome/installer/util/advanced_firewall_manager_win.cc
index 52a72180a84694aa17fc42b51116bd8bf1da8de1..1d94dd2f4d7f2cdd030c09bcc536c8688d3b8254 100644
--- a/chrome/installer/util/advanced_firewall_manager_win.cc
+++ b/chrome/installer/util/advanced_firewall_manager_win.cc
@@ -24,7 +24,8 @@ AdvancedFirewallManager::~AdvancedFirewallManager() {}
bool AdvancedFirewallManager::Init(const base::string16& app_name,
const base::FilePath& app_path) {
firewall_rules_ = NULL;
- HRESULT hr = firewall_policy_.CreateInstance(CLSID_NetFwPolicy2);
+ HRESULT hr = ::CoCreateInstance(CLSID_NetFwPolicy2, nullptr, CLSCTX_ALL,
+ IID_PPV_ARGS(&firewall_policy_));
if (FAILED(hr)) {
DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
firewall_policy_ = NULL;
@@ -127,7 +128,8 @@ base::win::ScopedComPtr<INetFwRule> AdvancedFirewallManager::CreateUDPRule(
uint16_t port) {
base::win::ScopedComPtr<INetFwRule> udp_rule;
- HRESULT hr = udp_rule.CreateInstance(CLSID_NetFwRule);
+ HRESULT hr = ::CoCreateInstance(CLSID_NetFwRule, nullptr, CLSCTX_ALL,
+ IID_PPV_ARGS(&udp_rule));
if (FAILED(hr)) {
DLOG(ERROR) << logging::SystemErrorCodeToString(hr);
return base::win::ScopedComPtr<INetFwRule>();
« no previous file with comments | « chrome/installer/gcapi/gcapi.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