Index: chrome/installer/util/shell_util.cc |
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc |
index f1ca375fae38baa06716b83c74c38b002e879492..fc2926246ef2540d1704dcc1ee233c8598f10185 100644 |
--- a/chrome/installer/util/shell_util.cc |
+++ b/chrome/installer/util/shell_util.cc |
@@ -10,6 +10,7 @@ |
#include "chrome/installer/util/shell_util.h" |
#include <windows.h> |
+#include <objbase.h> |
#include <shlobj.h> |
#include <shobjidl.h> |
@@ -758,7 +759,8 @@ bool LaunchDefaultAppsSettingsModernDialog(const wchar_t* protocol) { |
L"!microsoft.windows.immersivecontrolpanel"; |
base::win::ScopedComPtr<IApplicationActivationManager> activator; |
- HRESULT hr = activator.CreateInstance(CLSID_ApplicationActivationManager); |
+ HRESULT hr = ::CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, |
+ CLSCTX_ALL, IID_PPV_ARGS(&activator)); |
if (SUCCEEDED(hr)) { |
DWORD pid = 0; |
CoAllowSetForegroundWindow(activator.Get(), nullptr); |
@@ -1048,8 +1050,9 @@ ShellUtil::DefaultState ProbeCurrentDefaultHandlers( |
const wchar_t* const* protocols, |
size_t num_protocols) { |
base::win::ScopedComPtr<IApplicationAssociationRegistration> registration; |
- HRESULT hr = registration.CreateInstance( |
- CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC); |
+ HRESULT hr = |
+ ::CoCreateInstance(CLSID_ApplicationAssociationRegistration, NULL, |
+ CLSCTX_INPROC, IID_PPV_ARGS(®istration)); |
if (FAILED(hr)) |
return ShellUtil::UNKNOWN_DEFAULT; |
@@ -1074,8 +1077,9 @@ ShellUtil::DefaultState ProbeAppIsDefaultHandlers( |
const wchar_t* const* protocols, |
size_t num_protocols) { |
base::win::ScopedComPtr<IApplicationAssociationRegistration> registration; |
- HRESULT hr = registration.CreateInstance( |
- CLSID_ApplicationAssociationRegistration, NULL, CLSCTX_INPROC); |
+ HRESULT hr = |
+ ::CoCreateInstance(CLSID_ApplicationAssociationRegistration, NULL, |
+ CLSCTX_INPROC, IID_PPV_ARGS(®istration)); |
if (FAILED(hr)) |
return ShellUtil::UNKNOWN_DEFAULT; |
@@ -1877,8 +1881,8 @@ bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist, |
// the IApplicationAssociationRegistration interface. |
VLOG(1) << "Registering Chrome as default browser on Vista."; |
base::win::ScopedComPtr<IApplicationAssociationRegistration> pAAR; |
- HRESULT hr = pAAR.CreateInstance(CLSID_ApplicationAssociationRegistration, |
- NULL, CLSCTX_INPROC); |
+ HRESULT hr = ::CoCreateInstance(CLSID_ApplicationAssociationRegistration, |
+ NULL, CLSCTX_INPROC, IID_PPV_ARGS(&pAAR)); |
if (SUCCEEDED(hr)) { |
for (int i = 0; kBrowserProtocolAssociations[i] != NULL; i++) { |
hr = pAAR->SetAppAsDefault(app_name.c_str(), |
@@ -1984,8 +1988,8 @@ bool ShellUtil::MakeChromeDefaultProtocolClient( |
VLOG(1) << "Registering Chrome as default handler for " << protocol |
<< " on Vista."; |
base::win::ScopedComPtr<IApplicationAssociationRegistration> pAAR; |
- HRESULT hr = pAAR.CreateInstance(CLSID_ApplicationAssociationRegistration, |
- NULL, CLSCTX_INPROC); |
+ HRESULT hr = ::CoCreateInstance(CLSID_ApplicationAssociationRegistration, |
+ NULL, CLSCTX_INPROC, IID_PPV_ARGS(&pAAR)); |
if (SUCCEEDED(hr)) { |
base::string16 app_name = GetApplicationName(chrome_exe); |
hr = pAAR->SetAppAsDefault(app_name.c_str(), protocol.c_str(), |