Author: dquintana
Date: Mon Apr 28 15:29:38 2014
New Revision: 63033

URL: http://svn.reactos.org/svn/reactos?rev=63033&view=rev
Log:
[BROWSEUI]
* Make use of the IID_PPV_ARG for typesafe interface return pointers, and a few 
other cosmetic changes.
CORE-7330

Modified:
    branches/shell-experiments/dll/win32/browseui/aclmulti.cpp
    branches/shell-experiments/dll/win32/browseui/addressband.cpp
    branches/shell-experiments/dll/win32/browseui/bandproxy.cpp
    branches/shell-experiments/dll/win32/browseui/basebar.cpp
    branches/shell-experiments/dll/win32/browseui/basebarsite.cpp
    branches/shell-experiments/dll/win32/browseui/brandband.cpp
    branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
    branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
    branches/shell-experiments/dll/win32/browseui/toolsband.cpp
    branches/shell-experiments/dll/win32/browseui/travellog.cpp

Modified: branches/shell-experiments/dll/win32/browseui/aclmulti.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/aclmulti.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/aclmulti.cpp  [iso-8859-1] 
(original)
+++ branches/shell-experiments/dll/win32/browseui/aclmulti.cpp  [iso-8859-1] 
Mon Apr 28 15:29:38 2014
@@ -57,9 +57,9 @@
         CoTaskMemRealloc(fObjects, sizeof(fObjects[0]) * (fObjectCount + 1)));
     fObjects[fObjectCount].punk = punk;
     punk->AddRef();
-    if (FAILED(punk->QueryInterface(IID_IEnumString, reinterpret_cast<void 
**>(&fObjects[fObjectCount].pEnum))))
+    if (FAILED(punk->QueryInterface(IID_PPV_ARG(IEnumString, 
&fObjects[fObjectCount].pEnum))))
         fObjects[fObjectCount].pEnum = NULL;
-    if (FAILED(punk->QueryInterface(IID_IACList, reinterpret_cast<void 
**>(&fObjects[fObjectCount].pACL))))
+    if (FAILED(punk->QueryInterface(IID_PPV_ARG(IACList, 
&fObjects[fObjectCount].pACL))))
         fObjects[fObjectCount].pACL = NULL;
     fObjectCount++;
     return S_OK;

Modified: branches/shell-experiments/dll/win32/browseui/addressband.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/addressband.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addressband.cpp       
[iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/addressband.cpp       
[iso-8859-1] Mon Apr 28 15:29:38 2014
@@ -100,8 +100,7 @@
     CComPtr<IShellService>                  shellService;
     CComPtr<IUnknown>                       offset34;
     HWND                                    parentWindow;
-    IOleWindow                              *oleWindow;
-    HWND                                    toolbar;
+    HWND                                    combobox;
     static const TBBUTTON                   buttonInfo[] = { {0, 1, 
TBSTATE_ENABLED, 0} };
     HIMAGELIST                              normalImagelist;
     HIMAGELIST                              hotImageList;
@@ -112,28 +111,24 @@
     if (pUnkSite == NULL)
         return S_OK;
 
-    hResult = pUnkSite->QueryInterface(IID_IDockingWindowSite, 
reinterpret_cast<void **>(&fSite));
+    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, 
&fSite));
     if (FAILED(hResult))
         return hResult;
 
     // get window handle of parent
     parentWindow = NULL;
-    hResult = pUnkSite->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&oleWindow));
-    if (SUCCEEDED(hResult))
-    {
-        oleWindow->GetWindow(&parentWindow);
-        oleWindow->Release();
-    }
+    hResult = IUnknown_GetWindow(pUnkSite, &parentWindow);
+
     if (!::IsWindow(parentWindow))
         return E_FAIL;
 
     // create combo box ex
-    toolbar = CreateWindowEx(WS_EX_TOOLWINDOW, WC_COMBOBOXEXW, NULL, WS_CHILD 
| WS_VISIBLE |
+    combobox = CreateWindowEx(WS_EX_TOOLWINDOW, WC_COMBOBOXEXW, NULL, WS_CHILD 
| WS_VISIBLE |
                     WS_CLIPCHILDREN | WS_TABSTOP | CCS_NODIVIDER | CCS_NOMOVEY,
                     0, 0, 500, 250, parentWindow, (HMENU)0xa205, 
_AtlBaseModule.GetModuleInstance(), 0);
-    if (toolbar == NULL)
+    if (combobox == NULL)
         return E_FAIL;
-    SubclassWindow(toolbar);
+    SubclassWindow(combobox);
 
     SendMessage(CBEM_SETEXTENDEDSTYLE,
         CBES_EX_CASESENSITIVE | CBES_EX_NOSIZELIMIT, CBES_EX_CASESENSITIVE | 
CBES_EX_NOSIZELIMIT);
@@ -142,17 +137,17 @@
     fComboBox = reinterpret_cast<HWND>(SendMessage(CBEM_GETCOMBOCONTROL, 0, 
0));
 #if 1
     hResult = CoCreateInstance(CLSID_AddressEditBox, NULL, 
CLSCTX_INPROC_SERVER,
-        IID_IAddressEditBox, reinterpret_cast<void **>(&fAddressEditBox));
+        IID_PPV_ARG(IAddressEditBox, &fAddressEditBox));
     if (FAILED(hResult))
         return hResult;
 #else
     // instantiate new version
 #endif
 
-    hResult = fAddressEditBox->QueryInterface(IID_IShellService, 
reinterpret_cast<void **>(&shellService));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = fAddressEditBox->Init(toolbar, fEditControl, 8, pUnkSite 
/*(IAddressBand *)this*/ );
+    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService, 
&shellService));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = fAddressEditBox->Init(combobox, fEditControl, 8, pUnkSite 
/*(IAddressBand *)this*/);
     if (FAILED(hResult))
         return hResult;
     hResult = shellService->SetOwner(pUnkSite);
@@ -239,7 +234,7 @@
     CComPtr<IOleCommandTarget>              oleCommandTarget;
     HRESULT                                 hResult;
 
-    hResult = fAddressEditBox->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&oleCommandTarget));
+    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&oleCommandTarget));
     if (FAILED(hResult))
         return hResult;
     return oleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds, 
pCmdText);
@@ -272,7 +267,7 @@
 
     if (fActivate)
     {
-        hResult = fSite->QueryInterface(IID_IInputObjectSite, 
reinterpret_cast<void **>(&inputObjectSite));
+        hResult = fSite->QueryInterface(IID_PPV_ARG(IInputObjectSite, 
&inputObjectSite));
         if (FAILED(hResult))
             return hResult;
         hResult = inputObjectSite->OnFocusChangeIS(static_cast<IDeskBand 
*>(this), fActivate);
@@ -300,7 +295,7 @@
             }
             break;
     }
-    hResult = fAddressEditBox->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&winEventHandler));
+    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&winEventHandler));
     if (FAILED(hResult))
         return hResult;
     return winEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
@@ -313,7 +308,7 @@
 
     if (fAddressEditBox)
     {
-        hResult = fAddressEditBox->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&winEventHandler));
+        hResult = 
fAddressEditBox->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&winEventHandler));
         if (FAILED(hResult))
             return hResult;
         return winEventHandler->IsWindowOwner(hWnd);
@@ -326,7 +321,7 @@
     CComPtr<IAddressBand>                   addressBand;
     HRESULT                                 hResult;
 
-    hResult = fAddressEditBox->QueryInterface(IID_IAddressBand, 
reinterpret_cast<void **>(&addressBand));
+    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, 
&addressBand));
     if (FAILED(hResult))
         return hResult;
     return addressBand->FileSysChange(param8, paramC);
@@ -337,7 +332,7 @@
     CComPtr<IAddressBand>                   addressBand;
     HRESULT                                 hResult;
 
-    hResult = fAddressEditBox->QueryInterface(IID_IAddressBand, 
reinterpret_cast<void **>(&addressBand));
+    hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IAddressBand, 
&addressBand));
     if (FAILED(hResult))
         return hResult;
     return addressBand->Refresh(param8);

Modified: branches/shell-experiments/dll/win32/browseui/bandproxy.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/bandproxy.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/bandproxy.cpp [iso-8859-1] 
(original)
+++ branches/shell-experiments/dll/win32/browseui/bandproxy.cpp [iso-8859-1] 
Mon Apr 28 15:29:38 2014
@@ -43,7 +43,7 @@
 
     if (browser == NULL)
         return E_POINTER;
-    hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (FAILED(hResult))
         return hResult;
     hResult = serviceProvider->QueryService(
@@ -98,15 +98,15 @@
     hResult = FindBrowserWindow(&webBrowserUnknown);
     if (FAILED(hResult))
         return hResult;
-    hResult = webBrowserUnknown->QueryInterface(IID_IWebBrowserApp, 
reinterpret_cast<void **>(&webBrowser));
+    hResult = webBrowserUnknown->QueryInterface(IID_PPV_ARG(IWebBrowser2, 
&webBrowser));
     if (FAILED(hResult))
         return hResult;
     hResult = webBrowser->put_Visible(TRUE);
-    hResult = webBrowser->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = webBrowser->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (SUCCEEDED(hResult))
     {
         hResult = serviceProvider->QueryService(SID_STopLevelBrowser,
-            IID_IOleWindow, reinterpret_cast<void **>(&oleWindow));
+            IID_PPV_ARG(IOleWindow, &oleWindow));
         if (SUCCEEDED(hResult))
         {
             hResult = oleWindow->GetWindow(&browserWindow);

Modified: branches/shell-experiments/dll/win32/browseui/basebar.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/basebar.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/basebar.cpp   [iso-8859-1] 
(original)
+++ branches/shell-experiments/dll/win32/browseui/basebar.cpp   [iso-8859-1] 
Mon Apr 28 15:29:38 2014
@@ -179,7 +179,7 @@
     RECT                                    neededBorderSpace;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IDockingWindowSite, 
reinterpret_cast<void **>(&dockingWindowSite));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, 
&dockingWindowSite));
     if (FAILED(hResult))
         return hResult;
     hResult = dockingWindowSite->GetBorderDW(static_cast<IDeskBar *>(this), 
&availableBorderSpace);
@@ -272,7 +272,7 @@
 
     if (fSite == NULL)
         return E_FAIL;
-    hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (FAILED(hResult))
         return hResult;
     // called for SID_STopLevelBrowser, IID_IBrowserService to find top level 
browser
@@ -309,10 +309,10 @@
         fClient.Release();
     else
     {
-        hResult = punkClient->QueryInterface(IID_IUnknown, 
reinterpret_cast<void **>(&fClient));
+        hResult = punkClient->QueryInterface(IID_PPV_ARG(IUnknown, &fClient));
         if (FAILED(hResult))
             return hResult;
-        hResult = fSite->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&oleWindow));
+        hResult = fSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
         if (FAILED(hResult))
             return hResult;
         hResult = oleWindow->GetWindow(&ownerWindow);
@@ -471,7 +471,7 @@
     result = 0;
     if (fClient.p != NULL)
     {
-        hResult = fClient->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&winEventHandler));
+        hResult = fClient->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&winEventHandler));
         if (SUCCEEDED(hResult) && winEventHandler.p != NULL)
             hResult = winEventHandler->OnWinEvent(NULL, uMsg, wParam, lParam, 
&result);
     }

Modified: branches/shell-experiments/dll/win32/browseui/basebarsite.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/basebarsite.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/basebarsite.cpp       
[iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/basebarsite.cpp       
[iso-8859-1] Mon Apr 28 15:29:38 2014
@@ -170,19 +170,19 @@
     DWORD                                   thisBandID;
     HRESULT                                 hResult;
 
-    hResult = newBar->QueryInterface(IID_IPersist, reinterpret_cast<void 
**>(&persist));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = newBar->QueryInterface(IID_IObjectWithSite, 
reinterpret_cast<void **>(&site));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = newBar->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&oleWindow));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = newBar->QueryInterface(IID_IDeskBand, reinterpret_cast<void 
**>(&deskBand));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = newBar->QueryInterface(IID_IDockingWindow, reinterpret_cast<void 
**>(&dockingWindow));
+    hResult = newBar->QueryInterface(IID_PPV_ARG(IPersist, &persist));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = newBar->QueryInterface(IID_PPV_ARG(IObjectWithSite, &site));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = newBar->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = newBar->QueryInterface(IID_PPV_ARG(IDeskBand, &deskBand));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = newBar->QueryInterface(IID_PPV_ARG(IDockingWindow, 
&dockingWindow));
     if (FAILED(hResult))
         return hResult;
     hResult = site->SetSite(static_cast<IOleWindow *>(this));
@@ -266,7 +266,7 @@
 
     if (fDeskBarSite == NULL)
         return E_FAIL;
-    hResult = fDeskBarSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = fDeskBarSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (FAILED(hResult))
         return hResult;
     // called for SID_STopLevelBrowser, IID_IBrowserService to find top level 
browser
@@ -290,7 +290,7 @@
         notifyHeader = (NMHDR *)lParam;
         if (notifyHeader->hwndFrom == m_hWnd && notifyHeader->code == 
RBN_AUTOSIZE)
         {
-            hResult = fDeskBarSite->QueryInterface(IID_IDeskBar, 
reinterpret_cast<void **>(&deskBar));
+            hResult = fDeskBarSite->QueryInterface(IID_PPV_ARG(IDeskBar, 
&deskBar));
             GetClientRect(&newBounds);
             hResult = deskBar->OnPosRectChangeDB(&newBounds);
         }
@@ -298,7 +298,7 @@
     if (fCurrentActiveBar != NULL)
     {
         hResult = fCurrentActiveBar->fTheBar->QueryInterface(
-            IID_IWinEventHandler, reinterpret_cast<void **>(&winEventHandler));
+            IID_PPV_ARG(IWinEventHandler, &winEventHandler));
         if (SUCCEEDED(hResult) && winEventHandler.p != NULL)
             hResult = winEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, 
theResult);
     }
@@ -325,10 +325,10 @@
         fDeskBarSite.Release();
     else
     {
-        hResult = punkSite->QueryInterface(IID_IOleWindow, 
reinterpret_cast<void **>(&oleWindow));
+        hResult = punkSite->QueryInterface(IID_PPV_ARG(IOleWindow, 
&oleWindow));
         if (FAILED(hResult))
             return hResult;
-        hResult = punkSite->QueryInterface(IID_IUnknown, reinterpret_cast<void 
**>(&fDeskBarSite));
+        hResult = punkSite->QueryInterface(IID_PPV_ARG(IUnknown, 
&fDeskBarSite));
         if (FAILED(hResult))
             return hResult;
         hResult = oleWindow->GetWindow(&ownerWindow);

Modified: branches/shell-experiments/dll/win32/browseui/brandband.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/brandband.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/brandband.cpp [iso-8859-1] 
(original)
+++ branches/shell-experiments/dll/win32/browseui/brandband.cpp [iso-8859-1] 
Mon Apr 28 15:29:38 2014
@@ -170,11 +170,11 @@
     }
 
     // get window handle of parent
-    hResult = pUnkSite->QueryInterface(IID_IDockingWindowSite, 
reinterpret_cast<void **>(&fSite));
+    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, 
&fSite));
     if (FAILED(hResult))
         return hResult;
     parentWindow = NULL;
-    hResult = pUnkSite->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&oleWindow));
+    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
     if (SUCCEEDED(hResult))
         hResult = oleWindow->GetWindow(&parentWindow);
     if (!::IsWindow(parentWindow))
@@ -188,16 +188,16 @@
     SubclassWindow(hwnd);
 
     // take advice to watch events
-    hResult = pUnkSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (SUCCEEDED(hResult))
     {
         hResult = serviceProvider->QueryService(
-            SID_SBrandBand, IID_IProfferService, reinterpret_cast<void 
**>(&profferService));
+            SID_SBrandBand, IID_PPV_ARG(IProfferService, &profferService));
         if (SUCCEEDED(hResult))
             hResult = profferService->ProfferService(SID_SBrandBand,
                 static_cast<IServiceProvider *>(this), &fProfferCookie);
         hResult = serviceProvider->QueryService(SID_SShellBrowser,
-            IID_IBrowserService, reinterpret_cast<void **>(&browserService));
+            IID_PPV_ARG(IBrowserService, &browserService));
         if (SUCCEEDED(hResult))
             hResult = AtlAdvise(browserService, static_cast<IDispatch 
*>(this), DIID_DWebBrowserEvents, &fAdviseCookie);
     }
@@ -355,7 +355,7 @@
 
     if (IsEqualIID(guidService, SID_SBrandBand))
         return this->QueryInterface(riid, ppvObject);
-    hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (FAILED(hResult))
         return hResult;
     return serviceProvider->QueryService(guidService, riid, ppvObject);

Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp   
[iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp   
[iso-8859-1] Mon Apr 28 15:29:38 2014
@@ -161,13 +161,13 @@
     REBARBANDINFOW                          bandInfo;
     HRESULT                                 hResult;
 
-    hResult = containedBand->QueryInterface(IID_IObjectWithSite, 
reinterpret_cast<void **>(&site));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = containedBand->QueryInterface(IID_IOleWindow, 
reinterpret_cast<void **>(&oleWindow));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = containedBand->QueryInterface(IID_IDeskBand, 
reinterpret_cast<void **>(&deskBand));
+    hResult = containedBand->QueryInterface(IID_PPV_ARG(IObjectWithSite, 
&site));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = containedBand->QueryInterface(IID_PPV_ARG(IOleWindow, 
&oleWindow));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = containedBand->QueryInterface(IID_PPV_ARG(IDeskBand, &deskBand));
     if (FAILED(hResult))
         return hResult;
     fContainedBand = containedBand;
@@ -199,7 +199,7 @@
     CComPtr<IDeskBand>                      deskBand;
     HRESULT                                 hResult;
 
-    hResult = fContainedBand->QueryInterface(IID_IDeskBand, 
reinterpret_cast<void **>(&deskBand));
+    hResult = fContainedBand->QueryInterface(IID_PPV_ARG(IDeskBand, 
&deskBand));
     if (FAILED(hResult))
         return hResult;
 
@@ -362,7 +362,7 @@
     if (fFavoritesMenu.p == NULL)
     {
         // create favorites menu
-        hResult = psmd->punk->QueryInterface(IID_IShellMenu, 
reinterpret_cast<void **>(&parentMenu));
+        hResult = psmd->punk->QueryInterface(IID_PPV_ARG(IShellMenu, 
&parentMenu));
         if (FAILED(hResult))
             return hResult;
         hResult = parentMenu->GetMenu(&parentHMenu, &ownerWindow, NULL);
@@ -382,11 +382,11 @@
         else
         {
             hResult = CoCreateInstance(CLSID_MenuBand, NULL, 
CLSCTX_INPROC_SERVER,
-                IID_IShellMenu, reinterpret_cast<void **>(&newMenu));
+                IID_PPV_ARG(IShellMenu, &newMenu));
         }
 #else
         hResult = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
-            IID_IShellMenu, reinterpret_cast<void **>(&newMenu));
+            IID_PPV_ARG(IShellMenu, &newMenu));
 #endif
         if (FAILED(hResult))
             return hResult;
@@ -521,7 +521,7 @@
     RECT                                    neededBorderSpace;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IDockingWindowSite, 
reinterpret_cast<void **>(&dockingWindowSite));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, 
&dockingWindowSite));
     if (FAILED(hResult))
         return hResult;
     hResult = dockingWindowSite->GetBorderDW(static_cast<IDockingWindow 
*>(this), &availableBorderSpace);
@@ -573,27 +573,27 @@
     if (FAILED(hResult))
     {
         hResult = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
-            IID_IShellMenu, reinterpret_cast<void **>(menuBar));
+            IID_PPV_ARG(IShellMenu, menuBar));
     }
 #else
     hResult = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
-        IID_IShellMenu, reinterpret_cast<void **>(menuBar));
+        IID_PPV_ARG(IShellMenu, menuBar));
 #endif
     if (FAILED(hResult))
         return hResult;
-    hResult = fMenuCallback.QueryInterface(IID_IShellMenuCallback, 
reinterpret_cast<void **>(&callback));
+    hResult = fMenuCallback.QueryInterface(IID_PPV_ARG(IShellMenuCallback, 
&callback));
     if (FAILED(hResult))
         return hResult;
     hResult = (*menuBar)->Initialize(callback, -1, ANCESTORDEFAULT, 
SMINIT_HORIZONTAL | SMINIT_TOPLEVEL);
     if (FAILED(hResult))
         return hResult;
-    hResult = fSite->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&oleWindow));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
     if (FAILED(hResult))
         return hResult;
     hResult = oleWindow->GetWindow(&ownerWindow);
     if (FAILED(hResult))
         return hResult;
-    hResult = fSite->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&siteCommandTarget));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&siteCommandTarget));
     if (FAILED(hResult))
         return hResult;
     hResult = siteCommandTarget->Exec(&CGID_Explorer, 0x35, 0, NULL, &menuOut);
@@ -604,7 +604,7 @@
     hResult = (*menuBar)->SetMenu((HMENU)V_INTREF(&menuOut), ownerWindow, 
SMSET_DONTOWN);
     if (FAILED(hResult))
         return hResult;
-    hResult = (*menuBar)->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&commandTarget));
+    hResult = (*menuBar)->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&commandTarget));
     if (FAILED(hResult))
         return hResult;
     hResult = commandTarget->Exec(&CGID_MenuBand, 3, 1, NULL, NULL);
@@ -619,7 +619,7 @@
     HRESULT                                 hResult;
 
 #if 1
-    hResult = ::CreateBrandBand(IID_IUnknown, reinterpret_cast<void 
**>(logoBar));
+    hResult = ::CreateBrandBand(IID_PPV_ARG(IUnknown, logoBar));
 #else
     hResult = CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, 
IID_IUnknown,
         reinterpret_cast<void **>(logoBar));
@@ -633,7 +633,7 @@
 {
     HRESULT                                 hResult;
 
-    hResult = ::CreateToolsBar(IID_IUnknown, reinterpret_cast<void 
**>(toolsBar));
+    hResult = ::CreateToolsBar(IID_PPV_ARG(IUnknown, toolsBar));
     if (FAILED(hResult))
         return hResult;
     return S_OK;
@@ -645,14 +645,14 @@
     HRESULT                                 hResult;
 
 #if 1
-    hResult = ::CreateAddressBand(IID_IUnknown, reinterpret_cast<void 
**>(toolsBar));
+    hResult = ::CreateAddressBand(IID_PPV_ARG(IUnknown, toolsBar));
 #else
     hResult = CoCreateInstance(CLSID_SH_AddressBand, NULL, 
CLSCTX_INPROC_SERVER, IID_IUnknown,
         reinterpret_cast<void **>(toolsBar));
 #endif
     if (FAILED(hResult))
         return hResult;
-    hResult = (*toolsBar)->QueryInterface(IID_IAddressBand, 
reinterpret_cast<void **>(&addressBand));
+    hResult = (*toolsBar)->QueryInterface(IID_PPV_ARG(IAddressBand, 
&addressBand));
     return S_OK;
 }
 
@@ -719,13 +719,13 @@
     CComPtr<IServiceProvider>               serviceProvider;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = serviceProvider->QueryService(SID_IBandProxy, IID_IBandProxy, 
reinterpret_cast<void **>(&fBandProxy));
-    if (FAILED(hResult))
-    {
-        hResult = CreateBandProxy(IID_IBandProxy, reinterpret_cast<void 
**>(&fBandProxy));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = serviceProvider->QueryService(SID_IBandProxy, 
IID_PPV_ARG(IBandProxy, &fBandProxy));
+    if (FAILED(hResult))
+    {
+        hResult = CreateBandProxy(IID_PPV_ARG(IBandProxy, &fBandProxy));
         if (FAILED(hResult))
             return hResult;
         hResult = fBandProxy->SetSite(fSite);
@@ -770,7 +770,7 @@
 
     // show the bar here
     hResult = ReserveBorderSpace();
-    hResult = fMenuBar->QueryInterface(IID_IDockingWindow, 
reinterpret_cast<void **>(&dockingWindow));
+    hResult = fMenuBar->QueryInterface(IID_PPV_ARG(IDockingWindow, 
&dockingWindow));
     hResult = dockingWindow->ShowDW(fShow);
     return S_OK;
 }
@@ -832,7 +832,7 @@
     AddDockItem(menuBar, ITBBID_MENUBAND,
         CDockSite::ITF_NOTITLE | CDockSite::ITF_NEWBANDALWAYS | 
CDockSite::ITF_GRIPPERALWAYS);
 
-    hResult = menuBar->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&menuOleWindow));
+    hResult = menuBar->QueryInterface(IID_PPV_ARG(IOleWindow, &menuOleWindow));
     hResult = menuOleWindow->GetWindow(&fMenuBandWindow);
     fMenuBar.Attach(menuBar.Detach());                  // transfer the ref 
count
 
@@ -850,7 +850,7 @@
         return hResult;
     AddDockItem(toolsBar, ITBBID_TOOLSBAND, CDockSite::ITF_NOTITLE | 
CDockSite::ITF_NEWBANDALWAYS);
     fControlsBar.Attach(toolsBar.Detach());             // transfer the ref 
count
-    hResult = fControlsBar->QueryInterface(IID_IOleWindow, 
reinterpret_cast<void **>(&toolbarOleWindow));
+    hResult = fControlsBar->QueryInterface(IID_PPV_ARG(IOleWindow, 
&toolbarOleWindow));
     if (FAILED(hResult))
         return hResult;
     hResult = toolbarOleWindow->GetWindow(&fToolbarWindow);
@@ -862,7 +862,7 @@
     if (FAILED(hResult))
         return hResult;
     AddDockItem(navigationBar, ITBBID_ADDRESSBAND, 
CDockSite::ITF_NEWBANDALWAYS);
-    hResult = navigationBar->QueryInterface(IID_IOleWindow, 
reinterpret_cast<void **>(&navigationOleWindow));
+    hResult = navigationBar->QueryInterface(IID_PPV_ARG(IOleWindow, 
&navigationOleWindow));
     hResult = navigationOleWindow->GetWindow(&fNavigationWindow);
     fNavigationBar.Attach(navigationBar.Detach());
 
@@ -1002,7 +1002,7 @@
     HRESULT                                 hResult;
 
     fCommandTarget.Release();
-    hResult = theTarget->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&fCommandTarget));
+    hResult = theTarget->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&fCommandTarget));
     if (FAILED(hResult))
         return hResult;
     fCommandCategory = *category;
@@ -1109,7 +1109,7 @@
     else
     {
         // get window handle of owner
-        hResult = pUnkSite->QueryInterface(IID_IOleWindow, 
reinterpret_cast<void **>(&oleWindow));
+        hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, 
&oleWindow));
         if (FAILED(hResult))
             return hResult;
         hResult = oleWindow->GetWindow(&ownerWindow);
@@ -1135,9 +1135,9 @@
             return E_FAIL;
 
         // take advice to watch events
-        hResult = pUnkSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+        hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
         hResult = serviceProvider->QueryService(
-            SID_SShellBrowser, IID_IBrowserService, reinterpret_cast<void 
**>(&browserService));
+            SID_SShellBrowser, IID_PPV_ARG(IBrowserService, &browserService));
         hResult = AtlAdvise(browserService, static_cast<IDispatch *>(this), 
DIID_DWebBrowserEvents, &fAdviseCookie);
     }
     return S_OK;
@@ -1181,7 +1181,7 @@
 
     if (fMenuBar)
     {
-        hResult = fMenuBar->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&menuWinEventHandler));
+        hResult = fMenuBar->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&menuWinEventHandler));
         if (menuWinEventHandler->IsWindowOwner(hWnd))
         {
             return menuWinEventHandler->OnWinEvent(fMenuBandWindow, uMsg, 
wParam, lParam, theResult);
@@ -1212,9 +1212,9 @@
     if (ppstb == NULL)
         return E_POINTER;
     if (dwBandID == ITBBID_MENUBAND && fMenuBar.p != NULL)
-        return fMenuBar->QueryInterface(IID_IDeskBand, reinterpret_cast<void 
**>(ppstb));
+        return fMenuBar->QueryInterface(IID_PPV_ARG(IDeskBand, ppstb));
     //if (dwBandID == ITBBID_BRANDBAND && fLogoBar.p != NULL)
-    //    return fLogoBar->QueryInterface(IID_IDeskBand, reinterpret_cast<void 
**>(ppstb));
+    //    return fLogoBar->QueryInterface(IID_PPV_ARG(IDeskBand, ppstb));
     *ppstb = NULL;
     return E_FAIL;
 }
@@ -1250,11 +1250,11 @@
     CComPtr<IWebBrowser>                    webBrowser;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (FAILED(hResult))
         return 0;
     hResult = serviceProvider->QueryService(SID_SShellBrowser,
-        IID_IWebBrowser, reinterpret_cast<void **>(&webBrowser));
+        IID_PPV_ARG(IWebBrowser, &webBrowser));
     if (FAILED(hResult))
         return 0;
     hResult = webBrowser->GoBack();
@@ -1267,11 +1267,11 @@
     CComPtr<IWebBrowser>                    webBrowser;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
     if (FAILED(hResult))
         return 0;
     hResult = serviceProvider->QueryService(
-        SID_SShellBrowser, IID_IWebBrowser, reinterpret_cast<void 
**>(&webBrowser));
+        SID_SShellBrowser, IID_PPV_ARG(IWebBrowser, &webBrowser));
     if (FAILED(hResult))
         return 0;
     hResult = webBrowser->GoForward();
@@ -1283,7 +1283,7 @@
     CComPtr<IOleCommandTarget>              oleCommandTarget;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&oleCommandTarget));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&oleCommandTarget));
     if (FAILED(hResult))
         return hResult;
     hResult = oleCommandTarget->Exec(&CGID_ShellBrowser, IDM_GOTO_UPONELEVEL, 
0, NULL, NULL);
@@ -1307,10 +1307,10 @@
     commandInfo.nShow = SW_SHOWNORMAL;
 
     hResult = CoCreateInstance(CLSID_ShellSearchExt, NULL, 
CLSCTX_INPROC_SERVER,
-        IID_IContextMenu, reinterpret_cast<void **>(&contextMenu));
+        IID_PPV_ARG(IContextMenu, &contextMenu));
     if (FAILED(hResult))
         return 0;
-    hResult = contextMenu->QueryInterface(IID_IObjectWithSite, 
reinterpret_cast<void **>(&objectWithSite));
+    hResult = contextMenu->QueryInterface(IID_PPV_ARG(IObjectWithSite, 
&objectWithSite));
     if (FAILED(hResult))
         return 0;
     hResult = objectWithSite->SetSite(fSite);
@@ -1326,7 +1326,7 @@
     CComPtr<IOleCommandTarget>              oleCommandTarget;
     HRESULT                                 hResult;
 
-    hResult = fSite->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&oleCommandTarget));
+    hResult = fSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&oleCommandTarget));
     if (FAILED(hResult))
         return hResult;
     hResult = oleCommandTarget->Exec(&CGID_Explorer, 0x23, 0, NULL, NULL);
@@ -1372,12 +1372,12 @@
     {
         case gBackCommandID:
             newMenu = CreatePopupMenu();
-            hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+            hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
             hResult = serviceProvider->QueryService(
-                SID_SShellBrowser, IID_IBrowserService, reinterpret_cast<void 
**>(&browserService));
+                SID_SShellBrowser, IID_PPV_ARG(IBrowserService, 
&browserService));
             hResult = browserService->GetTravelLog(&travelLog);
             hResult = travelLog->InsertMenuEntries(browserService, newMenu, 0, 
1, 9, TLMENUF_BACK);
-            hResult = browserService->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&commandTarget));
+            hResult = 
browserService->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &commandTarget));
             commandInfo.cmdID = 0x1d;
             hResult = commandTarget->QueryStatus(&CGID_Explorer, 1, 
&commandInfo, NULL);
             if ((commandInfo.cmdf & (OLECMDF_ENABLED | OLECMDF_LATCHED)) == 
OLECMDF_ENABLED &&
@@ -1402,12 +1402,12 @@
             break;
         case gForwardCommandID:
             newMenu = CreatePopupMenu();
-            hResult = fSite->QueryInterface(IID_IServiceProvider, 
reinterpret_cast<void **>(&serviceProvider));
+            hResult = fSite->QueryInterface(IID_PPV_ARG(IServiceProvider, 
&serviceProvider));
             hResult = serviceProvider->QueryService(SID_SShellBrowser, 
IID_IBrowserService,
                 reinterpret_cast<void **>(&browserService));
             hResult = browserService->GetTravelLog(&travelLog);
             hResult = travelLog->InsertMenuEntries(browserService, newMenu, 0, 
1, 9, TLMENUF_FORE);
-            hResult = browserService->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&commandTarget));
+            hResult = 
browserService->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &commandTarget));
             commandInfo.cmdID = 0x1d;
             hResult = commandTarget->QueryStatus(&CGID_Explorer, 1, 
&commandInfo, NULL);
             if ((commandInfo.cmdf & (OLECMDF_ENABLED | OLECMDF_LATCHED)) == 
OLECMDF_ENABLED &&
@@ -1564,7 +1564,7 @@
         if (nID == (UINT)gBackCommandID || nID == (UINT)gForwardCommandID)
         {
             // TODO: Should this call QueryService?
-            hResult = fSite->QueryInterface(IID_IBrowserService, 
reinterpret_cast<void **>(&browserService));
+            hResult = fSite->QueryInterface(IID_PPV_ARG(IBrowserService, 
&browserService));
             hResult = browserService->GetTravelLog(&travelLog);
             hResult = travelLog->GetToolTipText(browserService,
                 (nID == (UINT)gBackCommandID) ? TLOG_BACK : TLOG_FORE,
@@ -1594,7 +1594,7 @@
     if (fMenuBar)
     {
         CComPtr<IWinEventHandler> menuWinEventHandler;
-        hResult = fMenuBar->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&menuWinEventHandler));
+        hResult = fMenuBar->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&menuWinEventHandler));
         if (SUCCEEDED(hResult))
         {
             if (menuWinEventHandler->IsWindowOwner(target) == S_OK)
@@ -1608,7 +1608,7 @@
     if (fNavigationBar)
     {
         CComPtr<IWinEventHandler> menuWinEventHandler;
-        hResult = fNavigationBar->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&menuWinEventHandler));
+        hResult = fNavigationBar->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&menuWinEventHandler));
         if (SUCCEEDED(hResult))
         {
             if (menuWinEventHandler->IsWindowOwner(target) == S_OK)
@@ -1632,7 +1632,7 @@
     if (fMenuBar)
     {
         CComPtr<IWinEventHandler> menuWinEventHandler;
-        hResult = fMenuBar->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&menuWinEventHandler));
+        hResult = fMenuBar->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&menuWinEventHandler));
         if (SUCCEEDED(hResult))
         {
             if (menuWinEventHandler->IsWindowOwner(notifyHeader->hwndFrom) == 
S_OK)
@@ -1646,7 +1646,7 @@
     if (fNavigationBar)
     {
         CComPtr<IWinEventHandler> menuWinEventHandler;
-        hResult = fNavigationBar->QueryInterface(IID_IWinEventHandler, 
reinterpret_cast<void **>(&menuWinEventHandler));
+        hResult = fNavigationBar->QueryInterface(IID_PPV_ARG(IWinEventHandler, 
&menuWinEventHandler));
         if (SUCCEEDED(hResult))
         {
             if (menuWinEventHandler->IsWindowOwner(notifyHeader->hwndFrom) == 
S_OK)

Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp      
[iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp      
[iso-8859-1] Mon Apr 28 15:29:38 2014
@@ -203,7 +203,7 @@
         desktop.p->AddRef ();
         return S_OK;
     }
-    return desktop->BindToObject (path, NULL, IID_IShellFolder, 
reinterpret_cast<void **>(newFolder));
+    return desktop->BindToObject (path, NULL, IID_PPV_ARG(IShellFolder, 
newFolder));
 }
 
 static const TCHAR szCabinetWndClass[] = TEXT("CabinetWClassX");
@@ -243,7 +243,7 @@
         SubclassWindow(myWindow);
         SetWindowPos(NULL, -32000, -32000, 0, 0, SWP_NOOWNERZORDER | 
SWP_NOZORDER);
         hResult = explorerToolbar->QueryInterface(
-            IID_IExplorerToolbar, reinterpret_cast<void 
**>(&fExplorerToolbar));
+            IID_PPV_ARG(IExplorerToolbar, &fExplorerToolbar));
     }
 }
 
@@ -754,19 +754,19 @@
 
     // create interfaces
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IDockingWindow, reinterpret_cast<void **>(&dockingWindow));
+        IID_PPV_ARG(IDockingWindow, &dockingWindow));
     if (FAILED(hResult))
         return hResult;
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IPersistStreamInit, reinterpret_cast<void **>(&persistStreamInit));
+        IID_PPV_ARG(IPersistStreamInit, &persistStreamInit));
     if (FAILED(hResult))
         return hResult;
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return hResult;
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IObjectWithSite, reinterpret_cast<void **>(&objectSite));
+        IID_PPV_ARG(IObjectWithSite, &objectSite));
     if (FAILED(hResult))
         return hResult;
 
@@ -952,7 +952,7 @@
     }
 
     // create view object
-    hResult = newShellFolder->CreateViewObject(m_hWnd, IID_IShellView, 
reinterpret_cast<void **>(&newShellView));
+    hResult = newShellFolder->CreateViewObject(m_hWnd, IID_PPV_ARG(IShellView, 
&newShellView));
     if (FAILED(hResult))
         return hResult;
     previousView = fCurrentShellViewWindow;
@@ -964,7 +964,7 @@
         ::SendMessage(fCurrentShellViewWindow, WM_SETREDRAW, 0, 0);
 
     // set site
-    hResult = newShellView->QueryInterface(IID_IObjectWithSite, 
reinterpret_cast<void **>(&objectWithSite));
+    hResult = newShellView->QueryInterface(IID_PPV_ARG(IObjectWithSite, 
&objectWithSite));
     if (SUCCEEDED(hResult) && objectWithSite.p != NULL)
         hResult = objectWithSite->SetSite(static_cast<IDropTarget *>(this));
 
@@ -1009,7 +1009,7 @@
 
     // get command target
     oleCommandTarget.Release();
-    hResult = newShellView->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&oleCommandTarget));
+    hResult = newShellView->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&oleCommandTarget));
 
     // no use
     saveCurrentShellView.Release();
@@ -1057,10 +1057,10 @@
     if (fClientBars[BIInternetToolbar].clientBar.p == NULL)
         return E_FAIL;
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IServiceProvider, reinterpret_cast<void **>(&serviceProvider));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = serviceProvider->QueryService(SID_IBandSite, IID_IBandSite, 
reinterpret_cast<void **>(&bandSite));
+        IID_PPV_ARG(IServiceProvider, &serviceProvider));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = serviceProvider->QueryService(SID_IBandSite, 
IID_PPV_ARG(IBandSite, &bandSite));
     if (FAILED(hResult))
         return hResult;
     hResult = bandSite->QueryBand(1, &deskBand, NULL, NULL, 0);
@@ -1085,15 +1085,15 @@
         cache = &fClientBars[BIHorizontalBaseBar].clientBar.p;
     if (*cache == NULL)
     {
-        hResult = CreateBaseBar(IID_IUnknown, reinterpret_cast<void 
**>(&newBaseBar));
+        hResult = CreateBaseBar(IID_PPV_ARG(IUnknown, &newBaseBar));
         if (FAILED(hResult))
             return hResult;
-        hResult = CreateBaseBarSite(IID_IUnknown, reinterpret_cast<void 
**>(&newBaseBarSite));
+        hResult = CreateBaseBarSite(IID_PPV_ARG(IUnknown, &newBaseBarSite));
         if (FAILED(hResult))
             return hResult;
 
         // tell the new base bar about the shell browser
-        hResult = newBaseBar->QueryInterface(IID_IObjectWithSite, 
reinterpret_cast<void **>(&objectWithSite));
+        hResult = newBaseBar->QueryInterface(IID_PPV_ARG(IObjectWithSite, 
&objectWithSite));
         if (FAILED(hResult))
             return hResult;
         hResult = objectWithSite->SetSite(static_cast<IDropTarget *>(this));
@@ -1101,7 +1101,7 @@
             return hResult;
 
         // tell the new base bar about the new base bar site
-        hResult = newBaseBar->QueryInterface(IID_IDeskBar, 
reinterpret_cast<void **>(&deskBar));
+        hResult = newBaseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
         if (FAILED(hResult))
             return hResult;
         hResult = deskBar->SetClient(newBaseBarSite);
@@ -1109,7 +1109,7 @@
             return hResult;
 
         // tell the new base bar site about the new base bar
-        hResult = newBaseBarSite->QueryInterface(IID_IDeskBarClient, 
reinterpret_cast<void **>(&deskBarClient));
+        hResult = newBaseBarSite->QueryInterface(IID_PPV_ARG(IDeskBarClient, 
&deskBarClient));
         if (FAILED(hResult))
             return hResult;
         hResult = deskBarClient->SetDeskBarSite(newBaseBar);
@@ -1118,7 +1118,7 @@
 
         *cache = newBaseBar.Detach();
     }
-    return (*cache)->QueryInterface(IID_IUnknown, reinterpret_cast<void 
**>(theBaseBar));
+    return (*cache)->QueryInterface(IID_PPV_ARG(IUnknown, theBaseBar));
 }
 
 HRESULT CShellBrowser::ShowBand(const CLSID &classID, bool vertical)
@@ -1132,6 +1132,8 @@
     VARIANT                                 vaIn;
     HRESULT                                 hResult;
 
+    __debugbreak();
+
     hResult = GetBaseBar(vertical, (IUnknown **)&theBaseBar);
     if (FAILED(hResult))
         return hResult;
@@ -1139,16 +1141,16 @@
         reinterpret_cast<void **>(&newBand));
     if (FAILED(hResult))
         return hResult;
-    hResult = theBaseBar->QueryInterface(IID_IDeskBar, reinterpret_cast<void 
**>(&deskBar));
+    hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDeskBar, &deskBar));
     if (FAILED(hResult))
         return hResult;
     hResult = deskBar->GetClient(&baseBarSite);
     if (FAILED(hResult))
         return hResult;
-    hResult = theBaseBar->QueryInterface(IID_IDockingWindow, 
reinterpret_cast<void **>(&dockingWindow));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = baseBarSite->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&oleCommandTarget));
+    hResult = theBaseBar->QueryInterface(IID_PPV_ARG(IDockingWindow, 
&dockingWindow));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = baseBarSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&oleCommandTarget));
     if (FAILED(hResult))
         return hResult;
     V_VT(&vaIn) = VT_UNKNOWN;
@@ -1205,12 +1207,12 @@
 
     // create sheet object
     hResult = CoCreateInstance(CLSID_ShellFldSetExt, NULL, 
CLSCTX_INPROC_SERVER,
-        IID_IShellPropSheetExt, reinterpret_cast<void 
**>(&folderOptionsSheet));
+        IID_PPV_ARG(IShellPropSheetExt, &folderOptionsSheet));
     if (FAILED(hResult))
         return E_FAIL;
 
     // must set site in order for Apply to all Folders on Advanced page to be 
enabled
-    hResult = folderOptionsSheet->QueryInterface(IID_IObjectWithSite, 
reinterpret_cast<void **>(&objectWithSite));
+    hResult = folderOptionsSheet->QueryInterface(IID_PPV_ARG(IObjectWithSite, 
&objectWithSite));
     if (SUCCEEDED(hResult) && objectWithSite.p != NULL)
         hResult = objectWithSite->SetSite(static_cast<IDispatch *>(this));
     m_PropSheet.phpage = m_psp;
@@ -1263,7 +1265,7 @@
     previousMessage = pThis->m_pCurrentMsg;
     pThis->m_pCurrentMsg = &msg;
 
-    hResult = pThis->GetMenuBand(IID_IMenuBand, reinterpret_cast<void 
**>(&menuBand));
+    hResult = pThis->GetMenuBand(IID_PPV_ARG(IMenuBand, &menuBand));
     if (SUCCEEDED(hResult) && menuBand.p != NULL)
     {
         hResult = menuBand->TranslateMenuMessage(&msg, &lResult);
@@ -1366,7 +1368,7 @@
         {
             CComPtr<IDispatch>          theDispatch;
 
-            hResult = (*pp)->QueryInterface(IID_IDispatch, 
reinterpret_cast<void **>(&theDispatch));
+            hResult = (*pp)->QueryInterface(IID_PPV_ARG(IDispatch, 
&theDispatch));
             hResult = theDispatch->Invoke(dispIdMember, GUID_NULL, 0, 
DISPATCH_METHOD, &params, NULL, NULL, NULL);
         }
         pp++;
@@ -1378,7 +1380,7 @@
         {
             CComPtr<IDispatch>          theDispatch;
 
-            hResult = (*pp)->QueryInterface(IID_IDispatch, 
reinterpret_cast<void **>(&theDispatch));
+            hResult = (*pp)->QueryInterface(IID_PPV_ARG(IDispatch, 
&theDispatch));
             hResult = theDispatch->Invoke(dispIdMember, GUID_NULL, 0, 
DISPATCH_METHOD, &params, NULL, NULL, NULL);
         }
         pp++;
@@ -1499,7 +1501,7 @@
     commandList[4].cmdID = ITID_CUSTOMIZEENABLED;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&oleCommandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &oleCommandTarget));
     if (SUCCEEDED(hResult))
         hResult = oleCommandTarget->QueryStatus(&CGID_PrivCITCommands, 5, 
commandList, NULL);
     if (FAILED(hResult))
@@ -1536,10 +1538,10 @@
         return true;
     if (int1 == NULL || int2 == NULL)
         return false;
-    hResult = int1->QueryInterface(IID_IUnknown, reinterpret_cast<void 
**>(&int1Retry));
+    hResult = int1->QueryInterface(IID_PPV_ARG(IUnknown, &int1Retry));
     if (FAILED(hResult))
         return false;
-    hResult = int2->QueryInterface(IID_IUnknown, reinterpret_cast<void 
**>(&int2Retry));
+    hResult = int2->QueryInterface(IID_PPV_ARG(IUnknown, &int2Retry));
     if (FAILED(hResult))
         return false;
     if (int1Retry == int2Retry)
@@ -1795,7 +1797,7 @@
 
     if (IsMenu(hmenuShared) == FALSE)
         return E_FAIL;
-    hResult = GetMenuBand(IID_IShellMenu, reinterpret_cast<void 
**>(&shellMenu));
+    hResult = GetMenuBand(IID_PPV_ARG(IShellMenu, &shellMenu));
     if (FAILED(hResult))
         return hResult;
     hResult = shellMenu->SetMenu(hmenuShared, NULL, SMSET_DONTOWN);
@@ -2006,7 +2008,7 @@
         *pptl = NULL;
     if (fTravelLog.p == NULL)
     {
-        hResult = CreateTravelLog(IID_ITravelLog, reinterpret_cast<void 
**>(&fTravelLog));
+        hResult = CreateTravelLog(IID_PPV_ARG(ITravelLog, &fTravelLog));
         if (FAILED(hResult))
             return hResult;
     }
@@ -2527,7 +2529,7 @@
     CComPtr<IOleCommandTarget>              oleCommandTarget;
     HRESULT                                 hResult;
 
-    hResult = fCurrentShellView->QueryInterface(IID_IOleCommandTarget, 
reinterpret_cast<void **>(&oleCommandTarget));
+    hResult = fCurrentShellView->QueryInterface(IID_PPV_ARG(IOleCommandTarget, 
&oleCommandTarget));
     if (FAILED(hResult))
         return hResult;
     return oleCommandTarget->Exec(NULL, 22, 1, Level, NULL);
@@ -2905,7 +2907,7 @@
         return E_FAIL;
     }
     hResult = CoCreateInstance(oldState.persistClass, NULL, 
CLSCTX_LOCAL_SERVER | CLSCTX_INPROC_SERVER,
-        IID_IOleObject, reinterpret_cast<void **>(&viewHistoryObject));
+        IID_PPV_ARG(IOleObject, &viewHistoryObject));
     fHistoryObject = viewHistoryObject;
     fHistoryStream = pStream;
     fHistoryBindContext = pbc;
@@ -2926,7 +2928,7 @@
     HRESULT                                 hResult;
 
     hResult = fCurrentShellView->GetItemObject(
-        SVGIO_BACKGROUND, IID_IPersistHistory, reinterpret_cast<void 
**>(&viewPersistHistory));
+        SVGIO_BACKGROUND, IID_PPV_ARG(IPersistHistory, &viewPersistHistory));
     memset(&newState, 0, sizeof(newState));
     newState.dwSize = sizeof(newState);
     newState.browseType = 2;
@@ -2985,7 +2987,7 @@
             if (fClientBars[x].clientBar != NULL)
             {
                 hResult = fClientBars[x].clientBar->QueryInterface(
-                    IID_IDockingWindow, reinterpret_cast<void 
**>(&dockingWindow));
+                    IID_PPV_ARG(IDockingWindow, &dockingWindow));
                 if (SUCCEEDED(hResult) && dockingWindow != NULL)
                 {
                     hResult = dockingWindow->ResizeBorderDW(
@@ -3122,7 +3124,7 @@
     HRESULT                                 hResult;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return 0;
     hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_TOOLBARLOCKED, 
0, NULL, NULL);
@@ -3135,7 +3137,7 @@
     HRESULT                                 hResult;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return 0;
     hResult = commandTarget->Exec(&CGID_PrivCITCommands, 
ITID_TOOLBARBANDSHOWN, 0, NULL, NULL);
@@ -3148,7 +3150,7 @@
     HRESULT                                 hResult;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return 0;
     hResult = commandTarget->Exec(&CGID_PrivCITCommands, 
ITID_ADDRESSBANDSHOWN, 0, NULL, NULL);
@@ -3161,7 +3163,7 @@
     HRESULT                                 hResult;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return 0;
     hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_LINKSBANDSHOWN, 
0, NULL, NULL);
@@ -3174,7 +3176,7 @@
     HRESULT                                 hResult;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return 0;
     hResult = commandTarget->Exec(&CGID_PrivCITCommands, ITID_TEXTLABELS, 0, 
NULL, NULL);
@@ -3187,7 +3189,7 @@
     HRESULT                                 hResult;
 
     hResult = fClientBars[BIInternetToolbar].clientBar->QueryInterface(
-        IID_IOleCommandTarget, reinterpret_cast<void **>(&commandTarget));
+        IID_PPV_ARG(IOleCommandTarget, &commandTarget));
     if (FAILED(hResult))
         return 0;
     hResult = commandTarget->Exec(&CGID_PrivCITCommands, 
ITID_CUSTOMIZEENABLED, 0, NULL, NULL);
@@ -3246,7 +3248,7 @@
     ATLTRY (theCabinet = new CComObject<CShellBrowser>);
     if (theCabinet == NULL)
         return E_OUTOFMEMORY;
-    hResult = theCabinet->QueryInterface(IID_IShellBrowser, 
reinterpret_cast<void **>(&shellBrowser));
+    hResult = theCabinet->QueryInterface(IID_PPV_ARG(IShellBrowser, 
&shellBrowser));
     if (FAILED(hResult))
     {
         delete theCabinet;

Modified: branches/shell-experiments/dll/win32/browseui/toolsband.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/toolsband.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] 
(original)
+++ branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] 
Mon Apr 28 15:29:38 2014
@@ -246,11 +246,11 @@
         fDockSite->Release();
     if (pUnkSite == NULL)
         return S_OK;
-    hResult = pUnkSite->QueryInterface(IID_IDockingWindowSite, 
reinterpret_cast<void **>(&fDockSite));
+    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, 
&fDockSite));
     if (FAILED(hResult))
         return hResult;
     parentWindow = NULL;
-    hResult = pUnkSite->QueryInterface(IID_IOleWindow, reinterpret_cast<void 
**>(&oleWindow));
+    hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &oleWindow));
     if (SUCCEEDED(hResult))
     {
         oleWindow->GetWindow(&parentWindow);

Modified: branches/shell-experiments/dll/win32/browseui/travellog.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/browseui/travellog.cpp?rev=63033&r1=63032&r2=63033&view=diff
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/travellog.cpp [iso-8859-1] 
(original)
+++ branches/shell-experiments/dll/win32/browseui/travellog.cpp [iso-8859-1] 
Mon Apr 28 15:29:38 2014
@@ -142,7 +142,7 @@
     CComPtr<IStream>                        globalStream;
     HRESULT                                 hResult;
 
-    hResult = punk->QueryInterface(IID_IPersistHistory, reinterpret_cast<void 
**>(&persistHistory));
+    hResult = punk->QueryInterface(IID_PPV_ARG(IPersistHistory, 
&persistHistory));
     if (FAILED(hResult))
         return hResult;
     hResult = CreateStreamOnHGlobal(fPersistState, FALSE, &globalStream);
@@ -167,10 +167,10 @@
     fPIDL = NULL;
     GlobalFree(fPersistState);
     fPersistState = NULL;
-    hResult = punk->QueryInterface(IID_ITravelLogClient, reinterpret_cast<void 
**>(&travelLogClient));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = punk->QueryInterface(IID_IPersistHistory, reinterpret_cast<void 
**>(&persistHistory));
+    hResult = punk->QueryInterface(IID_PPV_ARG(ITravelLogClient, 
&travelLogClient));
+    if (FAILED(hResult))
+        return hResult;
+    hResult = punk->QueryInterface(IID_PPV_ARG(IPersistHistory, 
&persistHistory));
     if (FAILED(hResult))
         return hResult;
     globalStorage = GlobalAlloc(GMEM_FIXED, 0);
@@ -364,7 +364,7 @@
     hResult = FindRelativeEntry(iOffset, &destinationEntry);
     if (FAILED(hResult))
         return hResult;
-    return destinationEntry->QueryInterface(IID_ITravelEntry, 
reinterpret_cast<void **>(ppte));
+    return destinationEntry->QueryInterface(IID_PPV_ARG(ITravelEntry, ppte));
 }
 
 HRESULT STDMETHODCALLTYPE CTravelLog::FindTravelEntry(IUnknown *punk, 
LPCITEMIDLIST pidl, ITravelEntry **ppte)


Reply via email to