Author: gadamopoulos
Date: Mon Nov 11 16:42:16 2013
New Revision: 60941
URL:
http://svn.reactos.org/svn/reactos?rev=60941&view=rev
Log:
[shell32]
- Add IID_PPV_ARG macro and use it in shell32 to make querying object interfaces type
safe
Modified:
trunk/reactos/dll/win32/shell32/CMenuBand.cpp
trunk/reactos/dll/win32/shell32/autocomplete.cpp
trunk/reactos/dll/win32/shell32/brsfolder.cpp
trunk/reactos/dll/win32/shell32/classes.cpp
trunk/reactos/dll/win32/shell32/dataobject.cpp
trunk/reactos/dll/win32/shell32/defcontextmenu.cpp
trunk/reactos/dll/win32/shell32/drive.cpp
trunk/reactos/dll/win32/shell32/enumidlist.cpp
trunk/reactos/dll/win32/shell32/folders.cpp
trunk/reactos/dll/win32/shell32/folders/admintools.cpp
trunk/reactos/dll/win32/shell32/folders/cpanel.cpp
trunk/reactos/dll/win32/shell32/folders/desktop.cpp
trunk/reactos/dll/win32/shell32/folders/fonts.cpp
trunk/reactos/dll/win32/shell32/folders/fs.cpp
trunk/reactos/dll/win32/shell32/folders/printers.cpp
trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp
trunk/reactos/dll/win32/shell32/fprop.cpp
trunk/reactos/dll/win32/shell32/newmenu.cpp
trunk/reactos/dll/win32/shell32/pidl.cpp
trunk/reactos/dll/win32/shell32/shell32_main.cpp
trunk/reactos/dll/win32/shell32/shellitem.cpp
trunk/reactos/dll/win32/shell32/shelllink.cpp
trunk/reactos/dll/win32/shell32/shellole.cpp
trunk/reactos/dll/win32/shell32/shellord.cpp
trunk/reactos/dll/win32/shell32/shlexec.cpp
trunk/reactos/dll/win32/shell32/shlfolder.cpp
trunk/reactos/dll/win32/shell32/shlfsbind.cpp
trunk/reactos/dll/win32/shell32/shlmenu.cpp
trunk/reactos/dll/win32/shell32/shlview.cpp
trunk/reactos/include/psdk/shlobj_undoc.h
Modified: trunk/reactos/dll/win32/shell32/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMenuBan…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CMenuBand.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CMenuBand.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -250,7 +250,7 @@
return S_OK;
hwndParent = NULL;
- hResult = pUnkSite->QueryInterface(IID_IOleWindow, reinterpret_cast<void
**>(&m_site));
+ hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &m_site));
if (SUCCEEDED(hResult))
{
m_site->GetWindow(&hwndParent);
Modified: trunk/reactos/dll/win32/shell32/autocomplete.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocomp…
==============================================================================
--- trunk/reactos/dll/win32/shell32/autocomplete.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/autocomplete.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -122,7 +122,7 @@
return this->hwndEdit ? E_FAIL : E_UNEXPECTED;
}
- if (!SUCCEEDED (punkACL->QueryInterface(IID_IEnumString, (LPVOID
*)&enumstr)))
+ if (!SUCCEEDED(punkACL->QueryInterface(IID_PPV_ARG(IEnumString,&enumstr))))
{
TRACE("No IEnumString interface\n");
return E_NOINTERFACE;
Modified: trunk/reactos/dll/win32/shell32/brsfolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/brsfolde…
==============================================================================
--- trunk/reactos/dll/win32/shell32/brsfolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/brsfolder.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -218,7 +218,7 @@
ILFree(pidlParent);
return;
}
- hr = lpsfDesktop->BindToObject(pidlParent, 0, IID_IShellFolder, (LPVOID
*)&lpsfParent);
+ hr = lpsfDesktop->BindToObject(pidlParent, 0, IID_PPV_ARG(IShellFolder,
&lpsfParent));
lpsfDesktop->Release();
}
@@ -230,7 +230,7 @@
}
if (pidlChild && pidlChild->mkid.cb) {
- hr = lpsfParent->BindToObject(pidlChild, 0, IID_IShellFolder, (LPVOID
*)&lpsfRoot);
+ hr = lpsfParent->BindToObject(pidlChild, 0, IID_PPV_ARG(IShellFolder,
&lpsfRoot));
} else {
lpsfRoot = lpsfParent;
hr = lpsfParent->AddRef();
@@ -417,7 +417,7 @@
lpsf->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
if (ulAttrs & SFGAO_FOLDER)
{
- hr = lpsf->BindToObject(pidlTemp, NULL, IID_IShellFolder, (LPVOID
*)&pSFChild);
+ hr = lpsf->BindToObject(pidlTemp, NULL, IID_PPV_ARG(IShellFolder,
&pSFChild));
if (SUCCEEDED(hr))
{
DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
@@ -519,8 +519,7 @@
return 0;
if (lptvid->lpi && lptvid->lpi->mkid.cb) {
- r = lptvid->lpsfParent->BindToObject(lptvid->lpi, 0,
- IID_IShellFolder, (LPVOID *)&lpsf2 );
+ r = lptvid->lpsfParent->BindToObject(lptvid->lpi, 0,
IID_PPV_ARG(IShellFolder, &lpsf2));
} else {
lpsf2 = lptvid->lpsfParent;
r = lpsf2->AddRef();
@@ -735,12 +734,12 @@
hr = SHGetDesktopFolder(&desktop);
if(FAILED(hr))
return hr;
- hr = desktop->BindToObject(info->pidlRet, 0, IID_IShellFolder, (LPVOID
*)&cur);
+ hr = desktop->BindToObject(info->pidlRet, 0, IID_PPV_ARG(IShellFolder,
&cur));
desktop->Release();
if(FAILED(hr))
return hr;
- hr = cur->QueryInterface(IID_ISFHelper, (LPVOID *)&sfhelper);
+ hr = cur->QueryInterface(IID_PPV_ARG(ISFHelper, &sfhelper));
if(FAILED(hr))
return hr;
Modified: trunk/reactos/dll/win32/shell32/classes.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/classes.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/classes.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/classes.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -487,8 +487,7 @@
hr = SHGetDesktopFolder(&psfDesktop);
if (SUCCEEDED(hr))
{
- hr = psfDesktop->BindToObject(pidlFolder, NULL, IID_IShellFolder,
- (LPVOID*)&psfFolder);
+ hr = psfDesktop->BindToObject(pidlFolder, NULL,
IID_PPV_ARG(IShellFolder,&psfFolder));
if (SUCCEEDED(hr))
hr = psfFolder->GetAttributesOf(0, NULL, pdwAttributes);
}
Modified: trunk/reactos/dll/win32/shell32/dataobject.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dataobje…
==============================================================================
--- trunk/reactos/dll/win32/shell32/dataobject.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dataobject.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -139,7 +139,7 @@
ATLTRY (theEnumerator = new CComObject<IEnumFORMATETCImpl>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumFORMATETC, (void
**)&result);
+ hResult = theEnumerator->QueryInterface (IID_PPV_ARG(IEnumFORMATETC,
&result));
if (FAILED (hResult))
{
delete theEnumerator;
@@ -362,7 +362,7 @@
ATLTRY (theDataObject = new CComObject<IDataObjectImpl>);
if (theDataObject == NULL)
return E_OUTOFMEMORY;
- hResult = theDataObject->QueryInterface (IID_IDataObject, (void **)&result);
+ hResult = theDataObject->QueryInterface(IID_PPV_ARG(IDataObject, &result));
if (FAILED (hResult))
{
delete theDataObject;
Modified: trunk/reactos/dll/win32/shell32/defcontextmenu.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/defconte…
==============================================================================
--- trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/defcontextmenu.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -139,7 +139,7 @@
IDataObject *pDataObj;
TRACE("cidl %u\n", pdcm->cidl);
- if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl,
NULL, IID_IDataObject, (void**)&pDataObj)))
+ if (SUCCEEDED(SHCreateDataObject(pdcm->pidlFolder, pdcm->cidl, pdcm->apidl,
NULL, IID_PPV_ARG(IDataObject, &pDataObj))))
m_pDataObj = pDataObj;
if (!pdcm->cidl)
@@ -150,7 +150,7 @@
else
{
IPersistFolder2 *pf = NULL;
- if (SUCCEEDED(pdcm->psf->QueryInterface(IID_IPersistFolder2,
(PVOID*)&pf)))
+ if (SUCCEEDED(pdcm->psf->QueryInterface(IID_PPV_ARG(IPersistFolder2,
&pf))))
{
if (FAILED(pf->GetCurFolder((_ITEMIDLIST**)&m_pidlFolder)))
ERR("GetCurFolder failed\n");
@@ -357,7 +357,7 @@
return S_OK;
IContextMenu *pcm;
- hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_IContextMenu, (void**)&pcm);
+ hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IContextMenu, &pcm));
if (hr != S_OK)
{
ERR("SHCoCreateInstance failed %x\n", GetLastError());
@@ -365,7 +365,7 @@
}
IShellExtInit *pExtInit;
- hr = pcm->QueryInterface(IID_IShellExtInit, (void**)&pExtInit);
+ hr = pcm->QueryInterface(IID_PPV_ARG(IShellExtInit, &pExtInit));
if (hr != S_OK)
{
ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid
%s\n", hr, wine_dbgstr_guid(pclsid));
@@ -998,7 +998,7 @@
/* use desktop shellfolder */
psfFrom = psfDesktop;
}
- else if (FAILED(psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder,
(LPVOID*)&psfFrom)))
+ else if (FAILED(psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder,
&psfFrom))))
{
ERR("no IShellFolder\n");
@@ -1016,7 +1016,7 @@
if (m_Dcm.cidl)
{
psfDesktop->Release();
- hr = m_Dcm.psf->BindToObject(m_Dcm.apidl[0], NULL, IID_IShellFolder,
(LPVOID*)&psfTarget);
+ hr = m_Dcm.psf->BindToObject(m_Dcm.apidl[0], NULL, IID_PPV_ARG(IShellFolder,
&psfTarget));
}
else
{
@@ -1024,7 +1024,7 @@
LPITEMIDLIST pidl;
/* cidl is zero due to explorer view */
- hr = m_Dcm.psf->QueryInterface(IID_IPersistFolder2, (LPVOID *) &ppf2);
+ hr = m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2));
if (SUCCEEDED(hr))
{
hr = ppf2->GetCurFolder(&pidl);
@@ -1039,7 +1039,7 @@
else
{
/* retrieve target desktop folder */
- hr = psfDesktop->BindToObject(pidl, NULL, IID_IShellFolder,
(LPVOID*)&psfTarget);
+ hr = psfDesktop->BindToObject(pidl, NULL,
IID_PPV_ARG(IShellFolder, &psfTarget));
}
TRACE("psfTarget %x %p, Desktop %u\n", hr, psfTarget,
_ILIsDesktop(pidl));
ILFree(pidl);
@@ -1062,7 +1062,7 @@
/* get source and destination shellfolder */
ISFHelper *psfhlpdst;
- if (FAILED(psfTarget->QueryInterface(IID_ISFHelper, (LPVOID*)&psfhlpdst)))
+ if (FAILED(psfTarget->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlpdst))))
{
ERR("no IID_ISFHelper for destination\n");
@@ -1077,7 +1077,7 @@
}
ISFHelper *psfhlpsrc;
- if (FAILED(psfFrom->QueryInterface(IID_ISFHelper, (LPVOID*)&psfhlpsrc)))
+ if (FAILED(psfFrom->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlpsrc))))
{
ERR("no IID_ISFHelper for source\n");
@@ -1185,7 +1185,7 @@
return E_FAIL;
IShellLinkW *pLink;
- hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_IShellLinkW,
(void**)&pLink);
+ hr = CShellLink::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellLinkW,
&pLink));
if (hr != S_OK)
return hr;
@@ -1196,7 +1196,7 @@
if (SUCCEEDED(pLink->SetPath(wszPath)) &&
SUCCEEDED(pLink->SetWorkingDirectory(szDirPath)))
{
- if (SUCCEEDED(pLink->QueryInterface(IID_IPersistFile,
(LPVOID*)&ppf)))
+ if (SUCCEEDED(pLink->QueryInterface(IID_PPV_ARG(IPersistFile,
&ppf))))
{
hr = ppf->Save(wszTarget, TRUE);
ppf->Release();
@@ -1280,7 +1280,7 @@
LPDATAOBJECT pDataObj;
HRESULT hr;
- if (SUCCEEDED(SHCreateDataObject(m_Dcm.pidlFolder, m_Dcm.cidl, m_Dcm.apidl, NULL,
IID_IDataObject, (void**)&pDataObj)))
+ if (SUCCEEDED(SHCreateDataObject(m_Dcm.pidlFolder, m_Dcm.cidl, m_Dcm.apidl, NULL,
IID_PPV_ARG(IDataObject, &pDataObj))))
{
hr = OleSetClipboard(pDataObj);
pDataObj->Release();
@@ -1364,7 +1364,7 @@
IPersistFolder2 *pf;
/* pidlFolder is optional */
- if (SUCCEEDED(m_Dcm.psf->QueryInterface(IID_IPersistFolder2,
(PVOID*)&pf)))
+ if (SUCCEEDED(m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2,
&pf))))
{
pf->GetCurFolder((_ITEMIDLIST**)&pidlParent);
pf->Release();
@@ -1794,7 +1794,7 @@
pdcm.cKeys = nKeys;
pdcm.aKeys = ahkeyClsKeys;
- HRESULT hr = SHCreateDefaultContextMenu(&pdcm, IID_IContextMenu, (void**)ppcm);
+ HRESULT hr = SHCreateDefaultContextMenu(&pdcm, IID_PPV_ARG(IContextMenu, ppcm));
return hr;
}
Modified: trunk/reactos/dll/win32/shell32/drive.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drive.cp…
==============================================================================
--- trunk/reactos/dll/win32/shell32/drive.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/drive.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -147,7 +147,7 @@
}
CComPtr<IDataObject> pDataObj;
- HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (LPVOID
*)&pDataObj);
+ HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject,
&pDataObj));
if (SUCCEEDED(hr))
{
Modified: trunk/reactos/dll/win32/shell32/enumidlist.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/enumidli…
==============================================================================
--- trunk/reactos/dll/win32/shell32/enumidlist.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/enumidlist.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -291,7 +291,7 @@
ATLTRY (theEnumerator = new CComObject<IEnumIDListImpl>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
Modified: trunk/reactos/dll/win32/shell32/folders.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -197,11 +197,11 @@
LPITEMIDLIST pSimplePidl = ILFindLastID(pidl);
HRESULT hr;
- hr = SHCreateDefaultExtractIcon(IID_IDefaultExtractIconInit, (void
**)&initIcon);
+ hr = SHCreateDefaultExtractIcon(IID_PPV_ARG(IDefaultExtractIconInit,&initIcon));
if (FAILED(hr))
return NULL;
- hr = initIcon->QueryInterface(IID_IExtractIconW, (void **)&extractIcon);
+ hr = initIcon->QueryInterface(IID_PPV_ARG(IExtractIconW,&extractIcon));
if (FAILED(hr))
return NULL;
@@ -383,7 +383,7 @@
if (!extractIconW)
return NULL;
- hr = extractIconW->QueryInterface(IID_IExtractIconA, (void **)&extractIconA);
+ hr = extractIconW->QueryInterface(IID_PPV_ARG(IExtractIconA, &extractIconA));
extractIconW->Release();
if (FAILED(hr))
return NULL;
Modified: trunk/reactos/dll/win32/shell32/folders/admintools.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/admintools.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/admintools.cpp [iso-8859-1] Mon Nov 11
16:42:16 2013
@@ -149,7 +149,7 @@
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumY>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
Modified: trunk/reactos/dll/win32/shell32/folders/cpanel.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -388,7 +388,7 @@
ATLTRY (theEnumerator = new CComObject<CControlPanelEnum>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
@@ -1024,11 +1024,11 @@
FIXME("Couldn't retrieve pointer to cpl structure\n");
return E_FAIL;
}
- hResult = CShellLink::_CreatorClass::CreateInstance(NULL, IID_IShellLinkA, (void
**)&isl);
+ hResult = CShellLink::_CreatorClass::CreateInstance(NULL,
IID_PPV_ARG(IShellLinkA, &isl));
if (SUCCEEDED(hResult))
{
isl->SetPath(szTarget);
- if (SUCCEEDED(isl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf)))
+ if (SUCCEEDED(isl->QueryInterface(IID_PPV_ARG(IPersistFile,&ppf))))
ppf->Save(szPath, TRUE);
}
return NOERROR;
Modified: trunk/reactos/dll/win32/shell32/folders/desktop.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -430,7 +430,7 @@
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
@@ -857,7 +857,7 @@
if (_ILGetGUIDPointer(pidl))
{
- if (SUCCEEDED(BindToObject(pidl, NULL, IID_IShellFolder2, (LPVOID *)&psf)))
+ if (SUCCEEDED(BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder2, &psf))))
{
hr = psf->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
return hr;
@@ -1218,7 +1218,7 @@
TRACE ("(%p)->(%p,%u,%p)\n", this, pSFFrom, cidl, apidl);
- pSFFrom->QueryInterface(IID_IPersistFolder2, (LPVOID *)&ppf2);
+ pSFFrom->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2));
if (ppf2)
{
if (FAILED(ppf2->GetCurFolder(&pidl)))
Modified: trunk/reactos/dll/win32/shell32/folders/fonts.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -233,7 +233,7 @@
ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumZ>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
@@ -314,7 +314,7 @@
}
else if (IsEqualIID (riid, IID_IShellView))
{
- hr = IShellView_Constructor ((IShellFolder *)this, &pShellView);
+ hr = IShellView_Constructor (this, &pShellView);
if (pShellView)
hr = pShellView->QueryInterface(riid, ppvOut);
}
@@ -345,7 +345,7 @@
CComPtr<IShellFolder> psfParent;
LPCITEMIDLIST rpidl = NULL;
- hr = SHBindToParent(pidlRoot, IID_IShellFolder, (LPVOID *)&psfParent,
(LPCITEMIDLIST *)&rpidl);
+ hr = SHBindToParent(pidlRoot, IID_PPV_ARG(IShellFolder, &psfParent),
(LPCITEMIDLIST *)&rpidl);
if (SUCCEEDED(hr))
SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
}
Modified: trunk/reactos/dll/win32/shell32/folders/fs.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -127,8 +127,7 @@
if (FAILED(r))
return NULL;
- r = param->QueryInterface(IID_IFileSystemBindData,
- (LPVOID*)&fsbd );
+ r = param->QueryInterface(IID_PPV_ARG(IFileSystemBindData,&fsbd));
if (SUCCEEDED(r))
{
r = fsbd->GetFindData(&wfd);
@@ -265,8 +264,8 @@
ATLTRY (theEnumerator = new CComObject<CFileSysEnum>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
- if (FAILED (hResult))
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
+ if (FAILED(hResult))
{
delete theEnumerator;
return hResult;
@@ -404,7 +403,7 @@
IShellFolder *psfParent = NULL;
LPCITEMIDLIST rpidl = NULL;
- hr = SHBindToParent(pidlRoot, IID_IShellFolder, (LPVOID*)&psfParent,
(LPCITEMIDLIST*)&rpidl);
+ hr = SHBindToParent(pidlRoot, IID_PPV_ARG(IShellFolder, &psfParent),
&rpidl);
if(SUCCEEDED(hr))
{
SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
@@ -1050,7 +1049,7 @@
TRACE ("(%p)->(%p,%u,%p)\n", this, pSFFrom, cidl, apidl);
- hr = pSFFrom->QueryInterface (IID_IPersistFolder2, (LPVOID *) & ppf2);
+ hr = pSFFrom->QueryInterface (IID_PPV_ARG(IPersistFolder2, &ppf2));
if (SUCCEEDED(hr))
{
hr = ppf2->GetCurFolder(&pidl);
Modified: trunk/reactos/dll/win32/shell32/folders/printers.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/printers.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/printers.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -389,7 +389,7 @@
ATLTRY (theEnumerator = new CComObject<CPrintersEnum>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface(IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
Modified: trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] Mon Nov 11
16:42:16 2013
@@ -505,7 +505,7 @@
ATLTRY (theEnumerator = new CComObject<CRecycleBinEnum>);
if (theEnumerator == NULL)
return E_OUTOFMEMORY;
- hResult = theEnumerator->QueryInterface(IID_IEnumIDList, (void **)&result);
+ hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result));
if (FAILED (hResult))
{
delete theEnumerator;
Modified: trunk/reactos/dll/win32/shell32/fprop.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.cp…
==============================================================================
--- trunk/reactos/dll/win32/shell32/fprop.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/fprop.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -128,7 +128,7 @@
Header.pszCaption = PathFindFileNameW(wszPath);
CComPtr<IDataObject> pDataObj;
- HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_IDataObject, (LPVOID
*)&pDataObj);
+ HRESULT hr = SHCreateDataObject(pidlFolder, 1, apidl, NULL, IID_PPV_ARG(IDataObject,
&pDataObj));
if (SUCCEEDED(hr))
{
Modified: trunk/reactos/dll/win32/shell32/newmenu.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/newmenu.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/newmenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/newmenu.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -350,15 +350,15 @@
// return E_FAIL;
/* Get current folder */
- hr = IUnknown_QueryService(psv, SID_IFolderView, IID_IFolderView, (void
**)&pFolderView);
+ hr = IUnknown_QueryService(psv, SID_IFolderView, IID_PPV_ARG(IFolderView,
&pFolderView));
if (FAILED(hr))
return hr;
- hr = pFolderView->GetFolder(IID_IShellFolder, (void **)&pParentFolder);
+ hr = pFolderView->GetFolder(IID_PPV_ARG(IShellFolder, &pParentFolder));
if (FAILED(hr))
return hr;
- hr = pParentFolder->QueryInterface(IID_ISFHelper, (LPVOID*)&psfhlp);
+ hr = pParentFolder->QueryInterface(IID_PPV_ARG(ISFHelper, &psfhlp));
if (FAILED(hr))
return hr;
@@ -394,19 +394,19 @@
WCHAR wszPath[MAX_PATH];
CComPtr<IFolderView> pFolderView;
CComPtr<IShellFolder> pParentFolder;
- CComPtr<IPersistFolder3> psf;
+ CComPtr<IPersistFolder2> psf;
HRESULT hr;
/* Get current folder */
- hr = IUnknown_QueryService(psv, SID_IFolderView, IID_IFolderView, (void
**)&pFolderView);
+ hr = IUnknown_QueryService(psv, SID_IFolderView, IID_PPV_ARG(IFolderView,
&pFolderView));
if (FAILED(hr))
return hr;
- hr = pFolderView->GetFolder(IID_IShellFolder, (void **)&pParentFolder);
+ hr = pFolderView->GetFolder(IID_PPV_ARG(IShellFolder, &pParentFolder));
if (FAILED(hr))
return hr;
- if (pParentFolder->QueryInterface(IID_IPersistFolder2, (LPVOID*)&psf) !=
S_OK)
+ if (pParentFolder->QueryInterface(IID_PPV_ARG(IPersistFolder2, &psf)) !=
S_OK)
{
ERR("Failed to get interface IID_IPersistFolder2\n");
return E_FAIL;
Modified: trunk/reactos/dll/win32/shell32/pidl.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/pidl.cpp…
==============================================================================
--- trunk/reactos/dll/win32/shell32/pidl.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/pidl.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -118,7 +118,7 @@
}
else
{
- ret = SHBindToParent(pidl, IID_IShellFolder, (LPVOID*)&psfParent,
&pidllast);
+ ret = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psfParent),
&pidllast);
if (SUCCEEDED(ret))
{
ret = psfParent->GetDisplayNameOf(pidllast, flag, &strret);
@@ -1221,7 +1221,7 @@
if (!pidl)
return FALSE;
- hr = SHBindToParent(pidl, IID_IShellFolder, (VOID**)&psfFolder, &pidlLast);
+ hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psfFolder), &pidlLast);
if (FAILED(hr))
{
ERR("SHBindToParent failed: %x\n", hr);
Modified: trunk/reactos/dll/win32/shell32/shell32_main.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32_main.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shell32_main.cpp [iso-8859-1] Mon Nov 11 16:42:16
2013
@@ -467,7 +467,7 @@
/* get the parent shellfolder */
if (pidl)
{
- hr = SHBindToParent( pidl, IID_IShellFolder, (LPVOID*)&psfParent,
+ hr = SHBindToParent( pidl, IID_PPV_ARG(IShellFolder, &psfParent),
(LPCITEMIDLIST*)&pidlLast );
if (SUCCEEDED(hr))
pidlLast = ILClone(pidlLast);
Modified: trunk/reactos/dll/win32/shell32/shellitem.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellite…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellitem.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellitem.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -69,7 +69,7 @@
{
hr = SHGetDesktopFolder(&desktop);
if (SUCCEEDED(hr))
- hr = desktop->BindToObject(parent_pidl, NULL, IID_IShellFolder,
reinterpret_cast<void **>(ppsf));
+ hr = desktop->BindToObject(parent_pidl, NULL, IID_PPV_ARG(IShellFolder,
ppsf));
ILFree(parent_pidl);
}
@@ -179,7 +179,7 @@
if (piOrder == NULL || oth == NULL)
return E_POINTER;
- hr = oth->QueryInterface(IID_IPersistIDList, reinterpret_cast<void
**>(&pIDList));
+ hr = oth->QueryInterface(IID_PPV_ARG(IPersistIDList, &pIDList));
if (SUCCEEDED(hr))
{
hr = pIDList->GetIDList(&pidl);
@@ -256,7 +256,7 @@
{
CComPtr<IPersistFolder2> ppf2Parent;
- if (FAILED(psfParent->QueryInterface(IID_IPersistFolder2,
(void**)&ppf2Parent)))
+ if (FAILED(psfParent->QueryInterface(IID_PPV_ARG(IPersistFolder2,
&ppf2Parent))))
{
FIXME("couldn't get IPersistFolder2 interface of
parent\n");
return E_NOINTERFACE;
@@ -284,14 +284,14 @@
return E_OUTOFMEMORY;
}
- hr = CShellItem::_CreatorClass::CreateInstance(NULL, IID_IShellItem,
(void**)&newShellItem);
+ hr = CShellItem::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellItem,
&newShellItem));
if (FAILED(hr))
{
*ppsi = NULL;
ILFree(new_pidl);
return hr;
}
- hr = newShellItem->QueryInterface(IID_IPersistIDList, (void
**)&newPersistIDList);
+ hr = newShellItem->QueryInterface(IID_PPV_ARG(IPersistIDList,
&newPersistIDList));
if (FAILED(hr))
{
ILFree(new_pidl);
Modified: trunk/reactos/dll/win32/shell32/shelllink.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelllin…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shelllink.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shelllink.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -1095,7 +1095,7 @@
{
LPCITEMIDLIST pidlLast;
- HRESULT hr = SHBindToParent(pidl, IID_IShellFolder, (LPVOID*)&psf,
&pidlLast);
+ HRESULT hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psf),
&pidlLast);
if (SUCCEEDED(hr))
{
@@ -1365,7 +1365,7 @@
LPCITEMIDLIST pidlLast;
UINT wFlags;
- HRESULT hr = SHBindToParent(pidl, IID_IShellFolder, (LPVOID*)&psf,
&pidlLast);
+ HRESULT hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psf),
&pidlLast);
if (SUCCEEDED(hr))
{
@@ -2111,7 +2111,7 @@
*ppv = NULL;
- hr = psl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
+ hr = psl->QueryInterface(IID_PPV_ARG(IPersistFile, &ppf));
if (SUCCEEDED(hr))
{
Modified: trunk/reactos/dll/win32/shell32/shellole.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -22,8 +22,6 @@
#include "precomp.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
-
-extern HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *
ppv);
static const WCHAR sShell32[12] =
{'S','H','E','L','L','3','2','.','D','L','L','\0'};
@@ -129,7 +127,7 @@
/* now we create an instance */
if (bLoadFromShell32) {
- if (! SUCCEEDED(DllGetClassObject(*myclsid, IID_IClassFactory,
(LPVOID*)&pcf))) {
+ if (! SUCCEEDED(DllGetClassObject(*myclsid, IID_PPV_ARG(IClassFactory,
&pcf)))) {
ERR("LoadFromShell failed for CLSID=%s\n",
shdebugstr_guid(myclsid));
}
} else if (bLoadWithoutCOM) {
@@ -286,7 +284,7 @@
if(!psf) return E_INVALIDARG;
*psf = NULL;
- hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_IShellFolder,
(void**)psf);
+ hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_PPV_ARG(IShellFolder,
psf));
TRACE("-- %p->(%p)\n",psf, *psf);
return hres;
@@ -388,7 +386,7 @@
ATLTRY (theClassObject = new CComObject<IDefClFImpl>);
if (theClassObject == NULL)
return E_OUTOFMEMORY;
- hResult = theClassObject->QueryInterface (IID_IClassFactory, (void
**)&result);
+ hResult = theClassObject->QueryInterface (IID_PPV_ARG(IClassFactory,
&result));
if (FAILED (hResult))
{
delete theClassObject;
Modified: trunk/reactos/dll/win32/shell32/shellord.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellord…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellord.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellord.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -934,12 +934,10 @@
hres = CoCreateInstance(CLSID_ShellLink,
NULL,
CLSCTX_INPROC_SERVER,
- IID_IShellLinkA,
- (void **)&psl);
+ IID_PPV_ARG(IShellLinkA,&psl));
if(SUCCEEDED(hres)) {
- hres = psl->QueryInterface(IID_IPersistFile,
- (LPVOID *)&pPf);
+ hres = psl->QueryInterface(IID_PPV_ARG(IPersistFile,&pPf));
if(FAILED(hres)) {
/* bombed */
ERR("failed QueryInterface for IPersistFile %08x\n", hres);
@@ -1021,7 +1019,7 @@
if (FAILED(hRes))
return hRes;
- hRes = psf->QueryInterface(IID_IShellView, (LPVOID *)ppv);
+ hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppv));
psf->Release();
return hRes;
@@ -1773,9 +1771,9 @@
/* Attempt to get an IShellPropSheetExt and an IShellExtInit
instance.
Only if both interfaces are supported it's a real shell
extension.
Then call IShellExtInit's Initialize method. */
- if (SUCCEEDED(CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER/* |
CLSCTX_NO_CODE_DOWNLOAD */, IID_IShellPropSheetExt, (LPVOID *)&pspsx)))
+ if (SUCCEEDED(CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER/* |
CLSCTX_NO_CODE_DOWNLOAD */, IID_PPV_ARG(IShellPropSheetExt, &pspsx))))
{
- if (SUCCEEDED(pspsx->QueryInterface(IID_IShellExtInit, (PVOID
*)&psxi)))
+ if (SUCCEEDED(pspsx->QueryInterface(IID_PPV_ARG(IShellExtInit,
&psxi))))
{
if (SUCCEEDED(psxi->Initialize(NULL, pDataObj, hKey)))
{
@@ -1900,7 +1898,7 @@
return hRes;
pef->AddRef();
- hRes = pef->QueryInterface(IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
+ hRes = pef->QueryInterface(IID_PPV_ARG(IEnumFORMATETC, ppenumFormatetc));
pef->Release();
return hRes;
@@ -1926,7 +1924,7 @@
if (FAILED(hRes))
return hRes;
- hRes = psf->QueryInterface(IID_IShellView, (LPVOID *)ppsv);
+ hRes = psf->QueryInterface(IID_PPV_ARG(IShellView, ppsv));
psf->Release();
return hRes;
Modified: trunk/reactos/dll/win32/shell32/shlexec.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlexec.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlexec.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -1224,7 +1224,7 @@
pidl = ILCreateFromPathW(fullpath);
}
- r = SHBindToParent(pidl, IID_IShellFolder, (LPVOID*)&shf, &pidllast);
+ r = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &shf), &pidllast);
if (FAILED(r))
goto end;
@@ -1324,7 +1324,7 @@
goto end;
r = CoCreateInstance(*guid, NULL, CLSCTX_INPROC_SERVER,
- IID_IShellExtInit, (LPVOID*)&obj);
+ IID_PPV_ARG(IShellExtInit, &obj));
if (FAILED(r))
{
ERR("failed %08x\n", r);
@@ -1693,7 +1693,7 @@
{
IShellExecuteHookW* pSEH;
- HRESULT hr = SHBindToParent((LPCITEMIDLIST)sei_tmp.lpIDList,
IID_IShellExecuteHookW, (LPVOID*)&pSEH, NULL);
+ HRESULT hr = SHBindToParent((LPCITEMIDLIST)sei_tmp.lpIDList,
IID_PPV_ARG(IShellExecuteHookW, &pSEH), NULL);
if (SUCCEEDED(hr))
{
Modified: trunk/reactos/dll/win32/shell32/shlfolder.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolde…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -133,7 +133,7 @@
TRACE ("(%p, %p, %p, %s)\n", psf, pbc, pidlInOut ? *pidlInOut : NULL,
debugstr_w (szNext));
/* get the shellfolder for the child pidl and let it analyse further */
- hr = psf->BindToObject(*pidlInOut, pbc, IID_IShellFolder, (LPVOID
*)&psfChild);
+ hr = psf->BindToObject(*pidlInOut, pbc, IID_PPV_ARG(IShellFolder,
&psfChild));
if (SUCCEEDED(hr)) {
hr = psfChild->ParseDisplayName(hwndOwner, pbc, szNext, pEaten, &pidlOut,
pdwAttributes);
@@ -171,10 +171,11 @@
LPCITEMIDLIST pidlChild, REFCLSID clsid, LPVOID * ppvOut)
{
HRESULT hr;
+ IShellFolder* pShellFolder;
TRACE ("%p %s %p\n", pidlRoot, debugstr_w(pathRoot), pidlChild);
- hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_IShellFolder, ppvOut);
+ hr = SHCoCreateInstance(NULL, &clsid, NULL, IID_PPV_ARG(IShellFolder,
&pShellFolder));
if (SUCCEEDED (hr))
{
LPITEMIDLIST pidlAbsolute = ILCombine (pidlRoot, pidlChild);
@@ -182,7 +183,7 @@
IPersistFolder3 *ppf;
if (_ILIsFolder(pidlChild) &&
- SUCCEEDED (((IUnknown *)(*ppvOut))->QueryInterface(IID_IPersistFolder3,
(LPVOID *) & ppf)))
+ SUCCEEDED(pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder3,
&ppf))))
{
PERSIST_FOLDER_TARGET_INFO ppfti;
@@ -210,7 +211,7 @@
ppf->InitializeEx(NULL, pidlAbsolute, &ppfti);
ppf->Release();
}
- else if (SUCCEEDED ((hr = ((IUnknown *)(*ppvOut))->QueryInterface
(IID_IPersistFolder, (LPVOID *) & pPF))))
+ else if (SUCCEEDED((hr =
pShellFolder->QueryInterface(IID_PPV_ARG(IPersistFolder, &pPF)))))
{
pPF->Initialize(pidlAbsolute);
pPF->Release();
@@ -218,6 +219,9 @@
ILFree (pidlAbsolute);
}
TRACE ("-- (%p) ret=0x%08x\n", *ppvOut, hr);
+
+ *ppvOut = pShellFolder;
+
return hr;
}
@@ -323,7 +327,7 @@
{
IShellFolder *psfChild;
- hr = psf->BindToObject(pidlFirst, NULL, IID_IShellFolder, (LPVOID *) &
psfChild);
+ hr = psf->BindToObject(pidlFirst, NULL, IID_PPV_ARG(IShellFolder,
&psfChild));
if (SUCCEEDED (hr))
{
STRRET strTemp;
@@ -454,7 +458,7 @@
if (SFGAO_HASSUBFOLDER & *pdwAttributes)
{
IShellFolder *psf2;
- if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID
*)&psf2)))
+ if (SUCCEEDED(psf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder,
&psf2))))
{
IEnumIDList *pEnumIL = NULL;
if (SUCCEEDED(psf2->EnumObjects(0, SHCONTF_FOLDERS, &pEnumIL)))
@@ -533,7 +537,7 @@
} else if (isEmpty2) {
return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 );
/* optimizing end */
- } else if (SUCCEEDED (iface->BindToObject(firstpidl, NULL, IID_IShellFolder,
(LPVOID *)&psf))) {
+ } else if (SUCCEEDED (iface->BindToObject(firstpidl, NULL,
IID_PPV_ARG(IShellFolder, &psf)))) {
nReturn = psf->CompareIDs(lParam, nextpidl1, nextpidl2);
psf->Release();
}
Modified: trunk/reactos/dll/win32/shell32/shlfsbind.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfsbin…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlfsbind.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlfsbind.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -66,7 +66,7 @@
*ppV = NULL;
- hResult = IFileSystemBindDataImpl::_CreatorClass::CreateInstance(NULL,
IID_IFileSystemBindData, (void **)&fileSystemBindData);
+ hResult = IFileSystemBindDataImpl::_CreatorClass::CreateInstance(NULL,
IID_PPV_ARG(IFileSystemBindData, &fileSystemBindData));
if (FAILED(hResult))
return hResult;
hResult = fileSystemBindData->SetFindData(pfd);
@@ -106,7 +106,7 @@
ret = pbc->GetObjectParam((LPOLESTR)wFileSystemBindData, &pUnk);
if (SUCCEEDED(ret))
{
- ret = pUnk->QueryInterface(IID_IFileSystemBindData, (LPVOID *)&pfsbd);
+ ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
if (SUCCEEDED(ret))
ret = pfsbd->GetFindData(pfd);
}
@@ -124,7 +124,7 @@
ret = pbc->GetObjectParam((LPOLESTR)wFileSystemBindData, &pUnk);
if (SUCCEEDED(ret))
{
- ret = pUnk->QueryInterface(IID_IFileSystemBindData, (LPVOID *)&pfsbd);
+ ret = pUnk->QueryInterface(IID_PPV_ARG(IFileSystemBindData, &pfsbd));
if (SUCCEEDED(ret))
ret = pfsbd->SetFindData(pfd);
}
Modified: trunk/reactos/dll/win32/shell32/shlmenu.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlmenu.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlmenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlmenu.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -156,7 +156,7 @@
if (SUCCEEDED (SHGetDesktopFolder(&lpsf)))
{
- if (SUCCEEDED(lpsf->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID
*)&lpsf2)))
+ if (SUCCEEDED(lpsf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder,
&lpsf2))))
{
IEnumIDList *lpe = NULL;
Modified: trunk/reactos/dll/win32/shell32/shlview.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -350,7 +350,7 @@
HRESULT WINAPI CDefView::Initialize(IShellFolder *shellFolder)
{
pSFParent = shellFolder;
- shellFolder->QueryInterface(IID_IShellFolder2, (LPVOID *)&pSF2Parent);
+ shellFolder->QueryInterface(IID_PPV_ARG(IShellFolder2, &pSF2Parent));
return S_OK;
}
@@ -936,11 +936,11 @@
}
}
- if (SUCCEEDED(this->QueryInterface(IID_IDropTarget, (LPVOID*)&pdt)))
+ if (SUCCEEDED(QueryInterface(IID_PPV_ARG(IDropTarget, &pdt))))
RegisterDragDrop(m_hWnd, pdt);
/* register for receiving notifications */
- pSFParent->QueryInterface(IID_IPersistFolder2, (LPVOID*)&ppf2);
+ pSFParent->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2));
if (ppf2)
{
ppf2->GetCurFolder((LPITEMIDLIST*)&ntreg.pidl);
@@ -1114,7 +1114,7 @@
if (!hMenu)
return E_FAIL;
- hResult = GetItemObject( SVGIO_SELECTION, IID_IContextMenu, (LPVOID *)&pCM);
+ hResult = GetItemObject( SVGIO_SELECTION, IID_PPV_ARG(IContextMenu2, &pCM));
if (FAILED(hResult))
goto cleanup;
@@ -1181,7 +1181,7 @@
cidl = ListView_GetSelectedCount(hWndList);
- hResult = GetItemObject( cidl ? SVGIO_SELECTION : SVGIO_BACKGROUND, IID_IContextMenu,
(LPVOID *)&pCM);
+ hResult = GetItemObject( cidl ? SVGIO_SELECTION : SVGIO_BACKGROUND,
IID_PPV_ARG(IContextMenu2, &pCM));
if (FAILED( hResult))
goto cleanup;
@@ -1235,7 +1235,7 @@
if (!hMenu)
return 0;
- hResult = GetItemObject( bUseSelection ? SVGIO_SELECTION : SVGIO_BACKGROUND,
IID_IContextMenu, (LPVOID *)&pCM);
+ hResult = GetItemObject( bUseSelection ? SVGIO_SELECTION : SVGIO_BACKGROUND,
IID_PPV_ARG(IContextMenu2, &pCM));
if (FAILED( hResult))
goto cleanup;
@@ -1958,7 +1958,7 @@
/* try to get the ICommDlgBrowserInterface, adds a reference !!! */
pCommDlgBrowser = NULL;
- if (SUCCEEDED(pShellBrowser->QueryInterface(IID_ICommDlgBrowser, (LPVOID
*)&pCommDlgBrowser)))
+ if (SUCCEEDED(pShellBrowser->QueryInterface(IID_PPV_ARG(ICommDlgBrowser,
&pCommDlgBrowser))))
{
TRACE("-- CommDlgBrowser\n");
}
@@ -2415,8 +2415,7 @@
{
/* We are not above one of the listview's subitems. Bind to the parent
folder's
* DropTarget interface. */
- hr = pSFParent->QueryInterface(IID_IDropTarget,
- (LPVOID*)&pCurDropTarget);
+ hr = pSFParent->QueryInterface(IID_PPV_ARG(IDropTarget,&pCurDropTarget));
}
else
{
@@ -2600,7 +2599,7 @@
if (theView == NULL)
return E_OUTOFMEMORY;
- hResult = theView->QueryInterface (IID_IShellView, (void **)&result);
+ hResult = theView->QueryInterface(IID_PPV_ARG(IShellView, &result));
if (FAILED (hResult))
{
delete theView;
Modified: trunk/reactos/include/psdk/shlobj_undoc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlobj_undoc.…
==============================================================================
--- trunk/reactos/include/psdk/shlobj_undoc.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shlobj_undoc.h [iso-8859-1] Mon Nov 11 16:42:16 2013
@@ -25,6 +25,12 @@
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
+
+#ifdef __cplusplus
+#define IID_PPV_ARG(Itype, ppType) IID_##Itype,
reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
+#else
+#define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
+#endif
/*****************************************************************************
* New shellstate structure