chore: replace uses of ComPtr::GetAddressOf() with ComPtr::operator& (#37992)

chore: replace uses of ComPtr::GetAddressOf() with ComPtr::operator&

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2023-04-17 10:38:30 +02:00
committed by GitHub
parent 35056392a8
commit b345ffd2f3

View File

@@ -278,7 +278,7 @@ void ShowItemInFolderOnWorkerThread(const base::FilePath& full_path) {
return;
Microsoft::WRL::ComPtr<IShellFolder> 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<IShellItem> 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;
}