[BROWSEUI]
[reactos.git] / dll / win32 / browseui / travellog.cpp
index ebdc45f..0bddc94 100644 (file)
@@ -40,6 +40,7 @@ TODO:
     Implement Revert
 
 */
+
 #include "precomp.h"
 
 class CTravelEntry :
@@ -141,7 +142,7 @@ HRESULT STDMETHODCALLTYPE CTravelEntry::Invoke(IUnknown *punk)
     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);
@@ -166,15 +167,10 @@ HRESULT STDMETHODCALLTYPE CTravelEntry::Update(IUnknown *punk, BOOL fIsLocalAnch
     fPIDL = NULL;
     GlobalFree(fPersistState);
     fPersistState = NULL;
-    hResult = punk->QueryInterface(IID_ITravelLogClient, reinterpret_cast<void **>(&travelLogClient));
-    if (FAILED(hResult))
-        return hResult;
-    hResult = travelLogClient->GetWindowData(&windowData);
+    hResult = punk->QueryInterface(IID_PPV_ARG(ITravelLogClient, &travelLogClient));
     if (FAILED(hResult))
         return hResult;
-    fPIDL = windowData.pidl;
-    // TODO: Properly free the windowData
-    hResult = punk->QueryInterface(IID_IPersistHistory, reinterpret_cast<void **>(&persistHistory));
+    hResult = punk->QueryInterface(IID_PPV_ARG(IPersistHistory, &persistHistory));
     if (FAILED(hResult))
         return hResult;
     globalStorage = GlobalAlloc(GMEM_FIXED, 0);
@@ -184,6 +180,11 @@ HRESULT STDMETHODCALLTYPE CTravelEntry::Update(IUnknown *punk, BOOL fIsLocalAnch
     hResult = persistHistory->SaveHistory(globalStream);
     if (FAILED(hResult))
         return hResult;
+    hResult = travelLogClient->GetWindowData(globalStream, &windowData);
+    if (FAILED(hResult))
+        return hResult;
+    fPIDL = windowData.pidl;
+    // TODO: Properly free the windowData
     hResult = GetHGlobalFromStream(globalStream, &fPersistState);
     if (FAILED(hResult))
         return hResult;
@@ -363,7 +364,7 @@ HRESULT STDMETHODCALLTYPE CTravelLog::GetTravelEntry(IUnknown *punk, int iOffset
     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)