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

chore: replace uses of ComPtr::GetAddressOf() with ComPtr::operator&
This commit is contained in:
Shelley Vohr 2023-04-17 02:08:37 +02:00 коммит произвёл GitHub
Родитель d1cddf2517
Коммит f0e1848a5e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -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;
}