From f0e1848a5e626232645c90decfaac2553eb30588 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 17 Apr 2023 02:08:37 +0200 Subject: [PATCH] chore: replace uses of `ComPtr::GetAddressOf()` with `ComPtr::operator&` (#37948) chore: replace uses of ComPtr::GetAddressOf() with ComPtr::operator& --- shell/common/platform_util_win.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/shell/common/platform_util_win.cc b/shell/common/platform_util_win.cc index 233cc6612b..22eded18a4 100644 --- a/shell/common/platform_util_win.cc +++ b/shell/common/platform_util_win.cc @@ -278,7 +278,7 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) { return; Microsoft::WRL::ComPtr desktop; - HRESULT hr = SHGetDesktopFolder(desktop.GetAddressOf()); + HRESULT hr = SHGetDesktopFolder(&desktop); if (FAILED(hr)) return; @@ -297,8 +297,7 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) { return; const ITEMIDLIST* highlight[] = {file_item}; - hr = SHOpenFolderAndSelectItems(dir_item, std::size(highlight), highlight, - NULL); + hr = SHOpenFolderAndSelectItems(dir_item, std::size(highlight), highlight, 0); if (FAILED(hr)) { // On some systems, the above call mysteriously fails with "file not // found" even though the file is there. In these cases, ShellExecute() @@ -379,9 +378,8 @@ bool MoveItemToTrashWithError(const base::FilePath& path, // Create an IShellItem from the supplied source path. Microsoft::WRL::ComPtr delete_item; - if (FAILED(SHCreateItemFromParsingName( - path.value().c_str(), NULL, - IID_PPV_ARGS(delete_item.GetAddressOf())))) { + if (FAILED(SHCreateItemFromParsingName(path.value().c_str(), NULL, + IID_PPV_ARGS(&delete_item)))) { *error = "Failed to parse path"; return false; }