[BROWSEUI]
authorDavid Quintana <gigaherz@gmail.com>
Mon, 28 Apr 2014 21:59:02 +0000 (21:59 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Mon, 28 Apr 2014 21:59:02 +0000 (21:59 +0000)
[SHELL32]
* Make use of IID_PPV_ARG (part 2).

svn path=/branches/shell-experiments/; revision=63040

18 files changed:
dll/win32/browseui/bandproxy.cpp
dll/win32/browseui/bandsite.cpp
dll/win32/browseui/basebar.cpp
dll/win32/browseui/internettoolbar.cpp
dll/win32/browseui/shellbrowser.cpp
dll/win32/shell32/defcontextmenu.cpp
dll/win32/shell32/folders.cpp
dll/win32/shell32/folders/admintools.cpp
dll/win32/shell32/folders/desktop.cpp
dll/win32/shell32/folders/fonts.cpp
dll/win32/shell32/folders/fs.cpp
dll/win32/shell32/folders/mycomp.cpp
dll/win32/shell32/folders/mydocuments.cpp
dll/win32/shell32/folders/netplaces.cpp
dll/win32/shell32/folders/recyclebin.cpp
dll/win32/shell32/shellole.cpp
dll/win32/shell32/shlexec.cpp
dll/win32/shell32/startmenu.cpp

index c5563dc..8417b77 100644 (file)
@@ -47,7 +47,7 @@ HRESULT CBandProxy::FindBrowserWindow(IUnknown **browser)
     if (FAILED(hResult))
         return hResult;
     hResult = serviceProvider->QueryService(
-        SID_IWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void **>(&webBrowser));
+        SID_IWebBrowserApp, IID_PPV_ARG(IWebBrowser2, &webBrowser));
     if (FAILED(hResult))
         return hResult;
     *browser = webBrowser.Detach();
index 43c214c..12511ca 100644 (file)
@@ -283,16 +283,16 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand(IUnknown *punk)
     if (punk == NULL || fRebarWindow == NULL)
         return E_FAIL;
 
-    hRet = punk->QueryInterface(IID_IDeskBand, reinterpret_cast<PVOID *>(&DeskBand));
+    hRet = punk->QueryInterface(IID_PPV_ARG(IDeskBand, &DeskBand));
     if (!SUCCEEDED(hRet) || DeskBand == NULL)
         goto Cleanup;
-    hRet = punk->QueryInterface(IID_IObjectWithSite, reinterpret_cast<PVOID *>(&ObjWithSite));
+    hRet = punk->QueryInterface(IID_PPV_ARG(IObjectWithSite, &ObjWithSite));
     if (!SUCCEEDED(hRet) || ObjWithSite == NULL)
         goto Cleanup;
-    hRet = punk->QueryInterface(IID_IOleWindow, reinterpret_cast<PVOID *>(&OleWindow));
+    hRet = punk->QueryInterface(IID_PPV_ARG(IOleWindow, &OleWindow));
     if (!SUCCEEDED(hRet) || OleWindow == NULL)
         goto Cleanup;
-    hRet = punk->QueryInterface(IID_IWinEventHandler, reinterpret_cast<PVOID *>(&WndEvtHandler));
+    hRet = punk->QueryInterface(IID_PPV_ARG(IWinEventHandler, &WndEvtHandler));
     if (!SUCCEEDED(hRet) || WndEvtHandler == NULL)
         goto Cleanup;
 
@@ -627,7 +627,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::SetDeskBarSite(IUnknown *pUnk)
 
     fOleWindow.Release();
 
-    hRet = pUnk->QueryInterface(IID_IOleWindow, (PVOID *)&fOleWindow);
+    hRet = pUnk->QueryInterface(IID_PPV_ARG(IOleWindow, &fOleWindow));
     if (FAILED(hRet))
         return E_FAIL;
 
index 2ca63c6..1395441 100644 (file)
@@ -430,21 +430,6 @@ HRESULT STDMETHODCALLTYPE CBaseBar::Save(IPropertyBag *pPropBag, BOOL fClearDirt
 
 LRESULT CBaseBar::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 {
-/*    CComPtr<IOleWindow>                       oleWindow;
-    RECT                                    clientRect;
-    HRESULT                                 hResult;
-
-    if (fClientWindow == NULL && fClient.p != NULL)
-    {
-        hResult = fClient->QueryInterface(IID_IOleWindow, (void **)&oleWindow);
-        hResult = oleWindow->GetWindow(&fClientWindow);
-    }
-    if (fClientWindow != NULL)
-    {
-        GetClientRect(&clientRect);
-        ::SetWindowPos(fClientWindow, NULL, clientRect.left, clientRect.top, clientRect.right - clientRect.left - GetSystemMetrics(SM_CXFRAME),
-                    clientRect.bottom - clientRect.top, SWP_NOOWNERZORDER | SWP_NOZORDER);
-    }*/
     return 0;
 }
 
index 79e7760..8a0401d 100644 (file)
@@ -621,8 +621,7 @@ HRESULT CInternetToolbar::CreateBrandBand(IUnknown **logoBar)
 #if 1
     hResult = ::CreateBrandBand(IID_PPV_ARG(IUnknown, logoBar));
 #else
-    hResult = CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown,
-        reinterpret_cast<void **>(logoBar));
+    hResult = CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, logoBar));
 #endif
     if (FAILED(hResult))
         return hResult;
@@ -647,8 +646,7 @@ HRESULT CInternetToolbar::CreateAddressBand(IUnknown **toolsBar)
 #if 1
     hResult = ::CreateAddressBand(IID_PPV_ARG(IUnknown, toolsBar));
 #else
-    hResult = CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown,
-        reinterpret_cast<void **>(toolsBar));
+    hResult = CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, toolsBar));
 #endif
     if (FAILED(hResult))
         return hResult;
@@ -1403,8 +1401,7 @@ LRESULT CInternetToolbar::OnMenuDropDown(UINT idControl, NMHDR *pNMHDR, BOOL &bH
         case gForwardCommandID:
             newMenu = CreatePopupMenu();
             hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &serviceProvider));
-            hResult = serviceProvider->QueryService(SID_SShellBrowser, IID_IBrowserService,
-                reinterpret_cast<void **>(&browserService));
+            hResult = serviceProvider->QueryService(SID_SShellBrowser, IID_PPV_ARG(IBrowserService, &browserService));
             hResult = browserService->GetTravelLog(&travelLog);
             hResult = travelLog->InsertMenuEntries(browserService, newMenu, 0, 1, 9, TLMENUF_FORE);
             hResult = browserService->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &commandTarget));
index a7485c0..c6072b8 100644 (file)
@@ -743,11 +743,11 @@ HRESULT CShellBrowser::Initialize(LPITEMIDLIST pidl, long b, long c, long d)
         return E_FAIL;
 
 #if 0
-    hResult = CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)&fClientBars[BIInternetToolbar].clientBar);
+    hResult = CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, &fClientBars[BIInternetToolbar].clientBar));
     if (FAILED(hResult))
         return hResult;
 #else
-    hResult = CreateInternetToolbar(IID_IUnknown, (void **)&fClientBars[BIInternetToolbar].clientBar);
+    hResult = CreateInternetToolbar(IID_PPV_ARG(IUnknown, &fClientBars[BIInternetToolbar].clientBar));
     if (FAILED(hResult))
         return hResult;
 #endif
@@ -903,8 +903,7 @@ HRESULT IEGetNameAndFlagsEx(LPITEMIDLIST pidl, SHGDNF uFlags, long param10,
     STRRET                                  L108;
     HRESULT                                 hResult;
 
-    hResult = SHBindToFolderIDListParent(NULL, pidl, &IID_IShellFolder,
-        reinterpret_cast<void **>(&parentFolder), &childPIDL);
+    hResult = SHBindToFolderIDListParent(NULL, pidl, &IID_PPV_ARG(IShellFolder, &parentFolder), &childPIDL);
     hResult = parentFolder->GetDisplayNameOf(childPIDL, uFlags, &L108);
     StrRetToBufW(&L108, childPIDL, pszBuf, cchBuf);
     if (rgfInOut)
@@ -1137,8 +1136,7 @@ HRESULT CShellBrowser::ShowBand(const CLSID &classID, bool vertical)
     hResult = GetBaseBar(vertical, (IUnknown **)&theBaseBar);
     if (FAILED(hResult))
         return hResult;
-    hResult = CoCreateInstance(classID, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown,
-        reinterpret_cast<void **>(&newBand));
+    hResult = CoCreateInstance(classID, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, &newBand));
     if (FAILED(hResult))
         return hResult;
     hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
@@ -1218,7 +1216,7 @@ HRESULT CShellBrowser::DoFolderOptions()
     m_PropSheet.phpage = m_psp;
 
 #if 0
-    hResult = CoCreateInstance(CLSID_GlobalFolderSettings, NULL, CLSCTX_INPROC_SERVER, IID_IGlobalFolderSettings, (void **)&globalSettings);
+    hResult = CoCreateInstance(CLSID_GlobalFolderSettings, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IGlobalFolderSettings, &globalSettings));
     if (FAILED(hResult))
         return E_FAIL;
     hResult = globalSettings->Get(&shellState, sizeof(shellState));
@@ -1601,8 +1599,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::QueryStatus(const GUID *pguidCmdGroup,
     {
         if (fCurrentShellView.p != NULL)
         {
-            hResult = fCurrentShellView->QueryInterface(IID_IOleCommandTarget,
-                reinterpret_cast<void **>(&commandTarget));
+            hResult = fCurrentShellView->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &commandTarget));
             if (SUCCEEDED(hResult) && commandTarget.p != NULL)
                 return commandTarget->QueryStatus(NULL, 1, prgCmds, pCmdText);
         }
index 6c5b2b8..5d96eb1 100644 (file)
@@ -1185,7 +1185,7 @@ CDefaultContextMenu::DoCopyOrCut(
         return hr;
     }
 
-    hr = lpSV->GetItemObject(SVGIO_SELECTION, IID_IDataObject, (LPVOID*)&pDataObj);
+    hr = lpSV->GetItemObject(SVGIO_SELECTION, IID_PPV_ARG(IDataObject, &pDataObj));
     if (SUCCEEDED(hr))
     {
         hr = OleSetClipboard(pDataObj);
index 9df6d6d..ad1afc6 100644 (file)
@@ -119,7 +119,7 @@ void InitIconOverlays(void)
             {
 
                 CLSIDFromString(szValue, &clsid);
-                dwResult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID*)&Overlay);
+                dwResult = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellIconOverlayIdentifier, &Overlay));
                 if (dwResult == S_OK)
                 {
                     Handlers[NumIconOverlayHandlers] = Overlay;
index 0e93a4f..198b57d 100644 (file)
@@ -303,11 +303,15 @@ HRESULT WINAPI CAdminToolsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCIT
 
     if (IsEqualIID (riid, IID_IContextMenu))
     {
-        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, (IShellFolder *)this, NULL, 0, NULL, (IContextMenu **)&pObj);
+        IContextMenu  * pCm = NULL;
+        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
+        pObj = pCm;
     }
     else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
     {
-        hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
+        IDataObject * pDo = NULL;
+        hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, &pDo);
+        pObj = pDo;
     }
     else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
     {
@@ -325,13 +329,15 @@ HRESULT WINAPI CAdminToolsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCIT
     }
     else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
     {
-        hr = this->QueryInterface(IID_IDropTarget, (LPVOID *)&pObj);
+        IDropTarget * pDt = NULL;
+        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+        pObj = pDt;
     }
     else if ((IsEqualIID(riid, IID_IShellLinkW) ||
               IsEqualIID(riid, IID_IShellLinkA)) && (cidl == 1))
     {
         pidl = ILCombine (pidlRoot, apidl[0]);
-        hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
+        hr = IShellLink_ConstructFromFile(NULL, riid, pidl, reinterpret_cast<LPVOID*>(&pObj));
         SHFree (pidl);
     }
     else
index 4f5ca9f..756d844 100644 (file)
@@ -651,9 +651,12 @@ HRESULT WINAPI CDesktopFolder::GetUIObjectOf(
     else if (IsEqualIID (riid, IID_IDropTarget))
     {
         /* only interested in attempting to bind to shell folders, not files, semicolon intentionate */
-        if (cidl == 1 && SUCCEEDED(hr = this->_GetDropTarget(apidl[0], (LPVOID*)&pObj)));
-        else
-            hr = this->QueryInterface(IID_IDropTarget, (LPVOID*)&pObj);
+        if (cidl != 1 || FAILED(hr = this->_GetDropTarget(apidl[0], (LPVOID*) &pObj)))
+        {
+            IDropTarget * pDt = NULL;
+            hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+            pObj = pDt;
+        }
     }
     else if ((IsEqualIID(riid, IID_IShellLinkW) ||
               IsEqualIID(riid, IID_IShellLinkA)) && (cidl == 1))
@@ -1474,7 +1477,7 @@ HRESULT WINAPI CDesktopFolder::Drop(IDataObject *pDataObject,
         if (SUCCEEDED(hr))
         {
             IDropTarget *pDT;
-            hr = this->BindToObject(pidl, NULL, IID_IDropTarget, (LPVOID*)&pDT);
+            hr = this->BindToObject(pidl, NULL, IID_PPV_ARG(IDropTarget, &pDT));
             CoTaskMemFree(pidl);
             if (SUCCEEDED(hr))
                 SHSimulateDrop(pDT, pDataObject, dwKeyState, NULL, pdwEffect);
@@ -1515,7 +1518,7 @@ HRESULT WINAPI CDesktopFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut
             if (SUCCEEDED(hr))
             {
                 IShellFolder *psf;
-                hr = this->BindToObject(pidlNext, NULL, IID_IShellFolder, (LPVOID*)&psf);
+                hr = this->BindToObject(pidlNext, NULL, IID_PPV_ARG(IShellFolder, &psf));
                 CoTaskMemFree(pidlNext);
                 if (SUCCEEDED(hr))
                 {
index c8ea368..7d903d7 100644 (file)
@@ -422,7 +422,9 @@ HRESULT WINAPI CFontsFolder::GetUIObjectOf(
     }
     else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
     {
-        hr = this->QueryInterface(IID_IDropTarget, (LPVOID *) & pObj);
+        IDropTarget * pDt = NULL;
+        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+        pObj = pDt;
     }
     else
         hr = E_NOINTERFACE;
index 76e19a0..47b5a61 100644 (file)
@@ -474,11 +474,16 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner,
     {
         *ppvOut = NULL;
 
-        if (IsEqualIID (riid, IID_IContextMenu) && (cidl >= 1))
-            hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)this, NULL, 0, NULL, (IContextMenu**)&pObj);
+        if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
+        {
+            IContextMenu  * pCm = NULL;
+            hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
+            pObj = pCm;
+        }
         else if (IsEqualIID (riid, IID_IDataObject))
         {
-            if (cidl >= 1) {
+            if (cidl >= 1) 
+            {
                 hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
             }
             else
@@ -503,9 +508,12 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner,
         else if (IsEqualIID (riid, IID_IDropTarget))
         {
             /* only interested in attempting to bind to shell folders, not files (except exe), so if we fail, rebind to root */
-            if (cidl == 1 && SUCCEEDED(hr = this->_GetDropTarget(apidl[0], (LPVOID*)&pObj)));
-            else
-                hr = this->QueryInterface(IID_IDropTarget, (LPVOID*)&pObj);
+            if (cidl != 1 || FAILED(hr = this->_GetDropTarget(apidl[0], (LPVOID*) &pObj)))
+            {
+                IDropTarget * pDt = NULL;
+                hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+                pObj = pDt;
+            }
         }
         else if ((IsEqualIID(riid, IID_IShellLinkW) ||
             IsEqualIID(riid, IID_IShellLinkA)) && (cidl == 1))
@@ -1529,7 +1537,7 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject,
         }
         else 
         {
-            hr = psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder, (LPVOID*)&psfFrom);
+            hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfFrom));
             if (FAILED(hr))
             {
                 ERR("no IShellFolder\n");
@@ -1549,7 +1557,7 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject,
             WCHAR wszPath[MAX_PATH];
             WCHAR wszTarget[MAX_PATH];
 
-            hr = this->QueryInterface(IID_IPersistFolder2, (LPVOID *) &ppf2);
+            hr = this->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2));
             if (SUCCEEDED(hr))
             {
                 hr = ppf2->GetCurFolder(&targetpidl);
@@ -1691,7 +1699,7 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject,
                 return E_FAIL;
             }
 
-            hr = this->QueryInterface(IID_IPersistFolder2, (LPVOID *) &ppf2);
+            hr = this->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2));
             if (SUCCEEDED(hr))
             {
                 hr = ppf2->GetCurFolder(&targetpidl);
index bdd5444..d9515ca 100644 (file)
@@ -462,8 +462,9 @@ HRESULT WINAPI CDrivesFolder::GetUIObjectOf(HWND hwndOwner,
     }
     else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
     {
-        hr = this->QueryInterface(IID_IDropTarget,
-                                  (LPVOID *) &pObj);
+        IDropTarget * pDt = NULL;
+        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+        pObj = pDt;
     }
     else if ((IsEqualIID(riid, IID_IShellLinkW) ||
               IsEqualIID(riid, IID_IShellLinkA)) && (cidl == 1))
index f1a0238..b5e99b4 100644 (file)
@@ -115,7 +115,7 @@ HRESULT WINAPI CMyDocsFolder::FinalConstruct()
 
     if (SUCCEEDED(hr))
     {
-        hr = psfDesktop->BindToObject(pidl, NULL, IID_IDropTarget, (LPVOID*) &mFSDropTarget);
+        hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IDropTarget, &mFSDropTarget));
         CoTaskMemFree(pidl);
         if (FAILED(hr))
             ERR("Error Binding");
@@ -388,12 +388,15 @@ HRESULT WINAPI CMyDocsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMID
 
     if (IsEqualIID (riid, IID_IContextMenu))
     {
-        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, (IShellFolder *)this, NULL, 0, NULL, (IContextMenu**)&pObj);
+        IContextMenu  * pCm = NULL;
+        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
+        pObj = pCm;
     }
     else if (IsEqualIID (riid, IID_IDataObject) && (cidl >= 1))
     {
-        hr = IDataObject_Constructor( hwndOwner,
-                                      pidlRoot, apidl, cidl, (IDataObject **)&pObj);
+        IDataObject * pDo = NULL;
+        hr = IDataObject_Constructor(hwndOwner, pidlRoot, apidl, cidl, &pDo);
+        pObj = pDo;
     }
     else if (IsEqualIID (riid, IID_IExtractIconA) && (cidl == 1))
     {
@@ -411,7 +414,9 @@ HRESULT WINAPI CMyDocsFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMID
     }
     else if (IsEqualIID (riid, IID_IDropTarget) && (cidl >= 1))
     {
-        hr = this->QueryInterface (IID_IDropTarget, (LPVOID *)&pObj);
+        IDropTarget * pDt = NULL;
+        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+        pObj = pDt;
     }
     else if ((IsEqualIID(riid, IID_IShellLinkW) ||
               IsEqualIID(riid, IID_IShellLinkA)) && (cidl == 1))
index 6075856..00b3c53 100644 (file)
@@ -244,11 +244,15 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLIS
 
     if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
     {
-        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, (IShellFolder*)this, NULL, 0, NULL, (IContextMenu**)&pObj);
+        IContextMenu  * pCm = NULL;
+        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
+        pObj = pCm;
     }
     else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1))
     {
-        hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, (IDataObject **)&pObj);
+        IDataObject * pDo = NULL;
+        hr = IDataObject_Constructor (hwndOwner, pidlRoot, apidl, cidl, &pDo);
+        pObj = pDo;
     }
     else if (IsEqualIID(riid, IID_IExtractIconA) && (cidl == 1))
     {
@@ -266,7 +270,9 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLIS
     }
     else if (IsEqualIID(riid, IID_IDropTarget) && (cidl >= 1))
     {
-        hr = this->QueryInterface(IID_IDropTarget, (LPVOID *) & pObj);
+        IDropTarget * pDt = NULL;
+        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+        pObj = pDt;
     }
     else
         hr = E_NOINTERFACE;
index 9b1a389..de50bd1 100644 (file)
@@ -622,7 +622,9 @@ HRESULT WINAPI CRecycleBin::GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLI
     }
     else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1))
     {
-        hr = this->QueryInterface(IID_IDropTarget, (LPVOID *) & pObj);
+        IDropTarget * pDt = NULL;
+        hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt));
+        pObj = pDt;
     }
     else
         hr = E_NOINTERFACE;
@@ -1531,7 +1533,7 @@ HRESULT WINAPI DoDeleteDataObject(IDataObject *pda)
     }
     else 
     {
-        hr = psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder, (LPVOID*)&psfFrom);
+        hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfFrom));
         if (FAILED(hr))
         {
             ERR("no IShellFolder\n");
index f39d1b5..56e6562 100644 (file)
@@ -146,7 +146,7 @@ HRESULT WINAPI SHCoCreateInstance(
             FreeLibrary( hLibrary );
         hres = E_ACCESSDENIED;
             goto end;
-        } else if (! SUCCEEDED(hres = DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
+        } else if (! SUCCEEDED(hres = DllGetClassObject(*myclsid, IID_PPV_ARG(IClassFactory, &pcf)))) {
             TRACE("GetClassObject failed 0x%08x\n", hres);
             goto end;
         }
index a270711..c9db589 100644 (file)
@@ -1252,7 +1252,7 @@ static HRESULT shellex_run_context_menu_default(IShellExtInit *obj,
 
     TRACE("%p %p\n", obj, sei);
 
-    r = obj->QueryInterface(IID_IContextMenu, (LPVOID*) &cm);
+    r = obj->QueryInterface(IID_PPV_ARG(IContextMenu, &cm));
     if (FAILED(r))
         return r;
 
@@ -1342,7 +1342,7 @@ static HRESULT shellex_load_object_and_run(HKEY hkey, LPCGUID guid, LPSHELLEXECU
     if (FAILED(r))
         goto end;
 
-    r = obj->QueryInterface(IID_IObjectWithSite, (LPVOID*) &ows);
+    r = obj->QueryInterface(IID_PPV_ARG(IObjectWithSite, &ows));
     if (FAILED(r))
         goto end;
 
index c4a960c..1ad9235 100644 (file)
@@ -117,7 +117,7 @@ HRESULT STDMETHODCALLTYPE CStartMenu::Initialize()
     if (pBandSiteObj == NULL)
         return E_OUTOFMEMORY;
 
-    hr = pBandSiteObj->QueryInterface(IID_IBandSite, (VOID**)&m_pBandSite);
+    hr = pBandSiteObj->QueryInterface(IID_PPV_ARG(IBandSite, &m_pBandSite));
     if (FAILED(hr))
         return NULL;