Migrate from ScopedComPtr::CreateInstance() to CoCreateInstance in chrome/...

https://codereview.chromium.org/2894483002
This commit is contained in:
Aleksei Kuzmin 2017-09-10 17:10:26 +02:00 committed by Cheng Zhao
parent 79e59a88b4
commit 7f5fbb04e2
4 changed files with 14 additions and 7 deletions

View file

@ -10,6 +10,7 @@
#include <comdef.h>
#include <commdlg.h>
#include <dwmapi.h>
#include <objbase.h>
#include <shellapi.h>
#include <shlobj.h>
@ -328,7 +329,8 @@ bool MoveItemToTrash(const base::FilePath& path) {
return false;
base::win::ScopedComPtr<IFileOperation> pfo;
if (FAILED(pfo.CreateInstance(CLSID_FileOperation)))
if (FAILED(::CoCreateInstance(CLSID_FileOperation, nullptr, CLSCTX_ALL,
IID_PPV_ARGS(&pfo))))
return false;
// Elevation prompt enabled for UAC protected files. This overrides the