Author: dquintana
Date: Tue Apr 29 11:14:29 2014
New Revision: 63044
URL:
http://svn.reactos.org/svn/reactos?rev=63044&view=rev
Log:
[RSHELL]
[SHELL32]
* Move the IID_NULL_PPV_ARG macro to the shobj_undoc header, next to the (also
ros-specific) IID_PPV_ARG macro, so that it can be used elsewhere.
[SHELL32]
* Make use of IID_NULL_PPV_ARG in all the calls to GetUIObjectOf, and fix one instance of
mismatched riid/pointer.
CORE-7330
Modified:
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/dll/win32/shell32/folders.cpp
branches/shell-experiments/dll/win32/shell32/iconcache.cpp
branches/shell-experiments/dll/win32/shell32/pidl.cpp
branches/shell-experiments/dll/win32/shell32/shell32_main.cpp
branches/shell-experiments/dll/win32/shell32/shelllink.cpp
branches/shell-experiments/dll/win32/shell32/shlexec.cpp
branches/shell-experiments/dll/win32/shell32/shlview.cpp
branches/shell-experiments/include/psdk/shlobj_undoc.h
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -1358,8 +1358,6 @@
CComPtr<IContextMenu> contextMenu = NULL;
LPCITEMIDLIST pidl = reinterpret_cast<LPCITEMIDLIST>(dwData);
-#define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL,
reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
-
hr = m_shellFolder->GetUIObjectOf(GetToolbar(), 1, &pidl,
IID_NULL_PPV_ARG(IContextMenu, &contextMenu));
if (FAILED_UNEXPECTEDLY(hr))
{
Modified: branches/shell-experiments/dll/win32/shell32/folders.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/folders.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/folders.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -235,7 +235,7 @@
hr = SHGetDesktopFolder(&psfDesktop);
if (SUCCEEDED(hr))
- hr = psfDesktop->BindToObject(pSimplePidl, NULL, IID_IShellFolder2,
(void**) &psfRecycleBin);
+ hr = psfDesktop->BindToObject(pSimplePidl, NULL,
IID_PPV_ARG(IShellFolder2, &psfRecycleBin));
if (SUCCEEDED(hr))
hr = psfRecycleBin->EnumObjects(NULL, SHCONTF_FOLDERS |
SHCONTF_NONFOLDERS, &EnumIDList);
@@ -379,7 +379,7 @@
if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
{
- HRESULT hr = dsf->GetUIObjectOf(NULL, 1,
(LPCITEMIDLIST*)&pidl, IID_IShellLinkW, NULL, (LPVOID *)&psl);
+ HRESULT hr = dsf->GetUIObjectOf(NULL, 1, (LPCITEMIDLIST*)
&pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl));
if (SUCCEEDED(hr))
{
Modified: branches/shell-experiments/dll/win32/shell32/iconcache.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/iconcache.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/iconcache.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -745,7 +745,7 @@
TRACE("sf=%p pidl=%p %s\n", sh, pidl,
bBigIcon?"Big":"Small");
- if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_IExtractIconW, 0, (void
**)&ei)))
+ if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_NULL_PPV_ARG(IExtractIconW,
&ei))))
{
if (SUCCEEDED(ei->GetIconLocation(uFlags, szIconFile, MAX_PATH,
&iSourceIndex, &dwFlags)))
{
Modified: branches/shell-experiments/dll/win32/shell32/pidl.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/pidl.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/pidl.cpp [iso-8859-1] Tue Apr 29 11:14:29
2014
@@ -686,8 +686,7 @@
CComPtr<IDataObject> pDataObj;
HRESULT hr;
- hr = lpsf->GetUIObjectOf(0, 1, &pidlSimple,
- IID_IDataObject, 0, (LPVOID*)&pDataObj);
+ hr = lpsf->GetUIObjectOf(0, 1, &pidlSimple, IID_NULL_PPV_ARG(IDataObject,
&pDataObj));
if (SUCCEEDED(hr))
{
STGMEDIUM medium;
Modified: branches/shell-experiments/dll/win32/shell32/shell32_main.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shell32_main.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shell32_main.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -566,7 +566,7 @@
/* get the iconlocation */
if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
{
- UINT uDummy,uFlags;
+ UINT uFlags;
if (flags & SHGFI_USEFILEATTRIBUTES)
{
@@ -602,8 +602,7 @@
else
{
hr = psfParent->GetUIObjectOf(0, 1,
- (LPCITEMIDLIST*)&pidlLast, IID_IExtractIconW,
- &uDummy, (LPVOID*)&pei);
+ (LPCITEMIDLIST*)&pidlLast, IID_NULL_PPV_ARG(IExtractIconW,
&pei));
if (SUCCEEDED(hr))
{
hr = pei->GetIconLocation(uGilFlags,
Modified: branches/shell-experiments/dll/win32/shell32/shelllink.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shelllink.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shelllink.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -1140,7 +1140,7 @@
{
CComPtr<IExtractIconA> pei;
- hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_IExtractIconA, NULL,
(LPVOID*)&pei);
+ hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_NULL_PPV_ARG(IExtractIconA,
&pei));
if (SUCCEEDED(hr))
hr = pei->GetIconLocation(0, pszIconPath, MAX_PATH, piIcon, NULL);
@@ -1410,7 +1410,7 @@
{
CComPtr<IExtractIconW> pei;
- hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_IExtractIconW, NULL,
(LPVOID*)&pei);
+ hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_NULL_PPV_ARG(IExtractIconW,
&pei));
if (SUCCEEDED(hr))
hr = pei->GetIconLocation(0, pszIconPath, MAX_PATH, piIcon, &wFlags);
@@ -2179,7 +2179,7 @@
if (SUCCEEDED(hr))
{
- hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_IDropTarget, NULL,
(LPVOID*)&mDropTarget);
+ hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_NULL_PPV_ARG(IDropTarget,
&mDropTarget));
if (SUCCEEDED(hr))
hr = mDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect);
Modified: branches/shell-experiments/dll/win32/shell32/shlexec.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlexec.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlexec.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -1228,8 +1228,7 @@
if (FAILED(r))
goto end;
- shf->GetUIObjectOf(NULL, 1, &pidllast,
- IID_IDataObject, NULL, (LPVOID*) &dataobj);
+ shf->GetUIObjectOf(NULL, 1, &pidllast, IID_NULL_PPV_ARG(IDataObject,
&dataobj));
end:
if (pidl != sei->lpIDList)
Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -1708,7 +1708,7 @@
DWORD dwAttributes = SFGAO_CANLINK;
DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
- if (SUCCEEDED(m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl,
(LPCITEMIDLIST*)m_apidl, IID_IDataObject, 0, (LPVOID *)&pda)))
+ if (SUCCEEDED(m_pSFParent->GetUIObjectOf(m_hWnd, m_cidl,
(LPCITEMIDLIST*)m_apidl, IID_NULL_PPV_ARG(IDataObject, &pda))))
{
IDropSource * pds = (IDropSource *)this; /* own DropSource
interface */
@@ -2678,8 +2678,7 @@
SendMessageW(m_hWndList, LVM_GETITEMW, 0, (LPARAM) &lvItem);
/* ... and bind m_pCurDropTarget to the IDropTarget interface of an UIObject of
this object */
- hr = m_pSFParent->GetUIObjectOf(m_hWndList, 1,
- (LPCITEMIDLIST*)&lvItem.lParam,
IID_IDropTarget, NULL, (LPVOID*)&m_pCurDropTarget);
+ hr = m_pSFParent->GetUIObjectOf(m_hWndList, 1,
(LPCITEMIDLIST*)&lvItem.lParam, IID_NULL_PPV_ARG(IDropTarget,
&m_pCurDropTarget));
}
/* If anything failed, m_pCurDropTarget should be NULL now, which ought to be a save
state. */
Modified: branches/shell-experiments/include/psdk/shlobj_undoc.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/psdk/…
==============================================================================
--- branches/shell-experiments/include/psdk/shlobj_undoc.h [iso-8859-1] (original)
+++ branches/shell-experiments/include/psdk/shlobj_undoc.h [iso-8859-1] Tue Apr 29
11:14:29 2014
@@ -27,9 +27,11 @@
#endif /* defined(__cplusplus) */
#ifdef __cplusplus
-#define IID_PPV_ARG(Itype, ppType) IID_##Itype,
reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
+# define IID_PPV_ARG(Itype, ppType) IID_##Itype,
reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
+# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL,
reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
#else
-#define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
+# define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
+# define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, (void**)(ppType)
#endif
/*****************************************************************************