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

Unified Diff: base/win/shortcut.cc

Issue 2887243002: Remove ScopedComPtr::CreateInstance() (Closed)
Patch Set: 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 | « base/win/scoped_comptr_unittest.cc ('k') | components/storage_monitor/portable_device_watcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/shortcut.cc
diff --git a/base/win/shortcut.cc b/base/win/shortcut.cc
index 5b36fbaf5aaa173e1a0c7efbb30b1afb031f2653..8cabf3842ee304a7583ad4b2c6b54502a6f07d93 100644
--- a/base/win/shortcut.cc
+++ b/base/win/shortcut.cc
@@ -4,6 +4,7 @@
#include "base/win/shortcut.h"
+#include <objbase.h>
#include <shellapi.h>
#include <shlobj.h>
#include <propkey.h>
@@ -31,8 +32,8 @@ void InitializeShortcutInterfaces(
ScopedComPtr<IPersistFile>* i_persist_file) {
i_shell_link->Reset();
i_persist_file->Reset();
- if (FAILED(i_shell_link->CreateInstance(CLSID_ShellLink, NULL,
- CLSCTX_INPROC_SERVER)) ||
+ if (FAILED(::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(i_shell_link->GetAddressOf()))) ||
FAILED(i_shell_link->CopyTo(i_persist_file->GetAddressOf())) ||
(shortcut && FAILED((*i_persist_file)->Load(shortcut, STGM_READWRITE)))) {
i_shell_link->Reset();
@@ -197,8 +198,8 @@ bool ResolveShortcutProperties(const FilePath& shortcut_path,
ScopedComPtr<IShellLink> i_shell_link;
// Get pointer to the IShellLink interface.
- if (FAILED(i_shell_link.CreateInstance(CLSID_ShellLink, NULL,
- CLSCTX_INPROC_SERVER))) {
+ if (FAILED(::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+ IID_PPV_ARGS(&i_shell_link)))) {
return false;
}
« no previous file with comments | « base/win/scoped_comptr_unittest.cc ('k') | components/storage_monitor/portable_device_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698