Browse Source

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

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 <[email protected]>
trop[bot] 2 years ago
parent
commit
62f64f9f03
1 changed files with 4 additions and 6 deletions
  1. 4 6
      shell/common/platform_util_win.cc

+ 4 - 6
shell/common/platform_util_win.cc

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