From 9ffdd562a15169217326fc367cd4f59248f793b5 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 17 May 2013 11:19:48 +0000 Subject: [PATCH] [BROWSEUI] * Fix ITravelLogClient::GetWindowData() definition (parameters) and correct its use. * Account for tlogstg.h where the ITravelLogClient interface is now defined. [PSDK] * Import tlogstg.idl from Wine 1.5.26. * Remove the now duplicated definitions from shobjidl.idl. [UUID] * Add tlogstg.idl. svn path=/trunk/; revision=59024 --- reactos/dll/win32/browseui/precomp.h | 1 + reactos/dll/win32/browseui/shellbrowser.cpp | 4 +- reactos/dll/win32/browseui/travellog.cpp | 10 ++-- reactos/include/psdk/CMakeLists.txt | 1 + reactos/include/psdk/shobjidl.idl | 38 --------------- reactos/include/psdk/tlogstg.idl | 52 +++++++++++++++++++++ reactos/lib/sdk/uuid/CMakeLists.txt | 2 +- 7 files changed, 62 insertions(+), 46 deletions(-) create mode 100644 reactos/include/psdk/tlogstg.idl diff --git a/reactos/dll/win32/browseui/precomp.h b/reactos/dll/win32/browseui/precomp.h index 3bcfc389ca2..9733a412726 100644 --- a/reactos/dll/win32/browseui/precomp.h +++ b/reactos/dll/win32/browseui/precomp.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/reactos/dll/win32/browseui/shellbrowser.cpp b/reactos/dll/win32/browseui/shellbrowser.cpp index 807eff1bfbd..7ab00742eba 100644 --- a/reactos/dll/win32/browseui/shellbrowser.cpp +++ b/reactos/dll/win32/browseui/shellbrowser.cpp @@ -601,7 +601,7 @@ public: // *** ITravelLogClient methods *** virtual HRESULT STDMETHODCALLTYPE FindWindowByIndex(DWORD dwID, IUnknown **ppunk); - virtual HRESULT STDMETHODCALLTYPE GetWindowData(LPWINDOWDATA pWinData); + virtual HRESULT STDMETHODCALLTYPE GetWindowData(IStream *pStream, LPWINDOWDATA pWinData); virtual HRESULT STDMETHODCALLTYPE LoadHistoryPosition(LPWSTR pszUrlLocation, DWORD dwPosition); // *** IPersist methods *** @@ -2890,7 +2890,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::FindWindowByIndex(DWORD dwID, IUnknown return E_NOTIMPL; } -HRESULT STDMETHODCALLTYPE CShellBrowser::GetWindowData(LPWINDOWDATA pWinData) +HRESULT STDMETHODCALLTYPE CShellBrowser::GetWindowData(IStream *pStream, LPWINDOWDATA pWinData) { if (pWinData == NULL) return E_POINTER; diff --git a/reactos/dll/win32/browseui/travellog.cpp b/reactos/dll/win32/browseui/travellog.cpp index ebdc45f5a07..cadfad0d890 100644 --- a/reactos/dll/win32/browseui/travellog.cpp +++ b/reactos/dll/win32/browseui/travellog.cpp @@ -169,11 +169,6 @@ HRESULT STDMETHODCALLTYPE CTravelEntry::Update(IUnknown *punk, BOOL fIsLocalAnch hResult = punk->QueryInterface(IID_ITravelLogClient, reinterpret_cast(&travelLogClient)); if (FAILED(hResult)) return hResult; - hResult = travelLogClient->GetWindowData(&windowData); - if (FAILED(hResult)) - return hResult; - fPIDL = windowData.pidl; - // TODO: Properly free the windowData hResult = punk->QueryInterface(IID_IPersistHistory, reinterpret_cast(&persistHistory)); if (FAILED(hResult)) return hResult; @@ -184,6 +179,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; diff --git a/reactos/include/psdk/CMakeLists.txt b/reactos/include/psdk/CMakeLists.txt index fab06367c95..feae9deecef 100644 --- a/reactos/include/psdk/CMakeLists.txt +++ b/reactos/include/psdk/CMakeLists.txt @@ -99,6 +99,7 @@ list(APPEND SOURCE strmif.idl structuredquerycondition.idl textstor.idl + tlogstg.idl tom.idl tuner.idl unknwn.idl diff --git a/reactos/include/psdk/shobjidl.idl b/reactos/include/psdk/shobjidl.idl index 5fb0d9122da..f6fc83af9ea 100644 --- a/reactos/include/psdk/shobjidl.idl +++ b/reactos/include/psdk/shobjidl.idl @@ -2364,20 +2364,6 @@ interface IShellMenu : IUnknown } -typedef struct _WINDOWDATA -{ - DWORD dwWindowID; - UINT uiCP; - LPITEMIDLIST pidl; - [string] LPWSTR lpszUrl; - [string] LPWSTR lpszUrlLocation; - [string] LPWSTR lpszTitle; -} WINDOWDATA; - -typedef WINDOWDATA *LPWINDOWDATA; -typedef const WINDOWDATA *LPCWINDOWDATA; - - /***************************************************************************** * ITravelEntry interface */ @@ -2401,30 +2387,6 @@ interface ITravelEntry : IUnknown }; -/***************************************************************************** - * ITravelLogClient interface - */ -[ - uuid(241c033e-e659-43da-aa4d-4086dbc4758d), - object, - pointer_default(unique), - local -] -interface ITravelLogClient : IUnknown -{ - HRESULT FindWindowByIndex( - [in] DWORD dwID, - [out] IUnknown **ppunk); - - HRESULT GetWindowData( - [out] LPWINDOWDATA pWinData); - - HRESULT LoadHistoryPosition( - [in] LPWSTR pszUrlLocation, - [in] DWORD dwPosition); -}; - - /***************************************************************************** * ITravelLog interface */ diff --git a/reactos/include/psdk/tlogstg.idl b/reactos/include/psdk/tlogstg.idl new file mode 100644 index 00000000000..ff82ffca715 --- /dev/null +++ b/reactos/include/psdk/tlogstg.idl @@ -0,0 +1,52 @@ +/* + * Copyright 2012 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "objidl.idl"; +import "oleidl.idl"; +import "shtypes.idl"; + +typedef struct _WINDOWDATA { + DWORD dwWindowID; + UINT uiCP; + PIDLIST_ABSOLUTE pidl; + [string] LPWSTR lpszUrl; + [string] LPWSTR lpszUrlLocation; + [string] LPWSTR lpszTitle; +} WINDOWDATA; + +typedef WINDOWDATA *LPWINDOWDATA; +typedef const WINDOWDATA *LPCWINDOWDATA; + +[ + uuid(241c033e-e659-43da-aa4d-4086dbc4758d), + object +] +interface ITravelLogClient : IUnknown +{ + HRESULT FindWindowByIndex( + [in] DWORD dwID, + [out] IUnknown **ppunk); + + HRESULT GetWindowData( + [in] IStream *pStream, + [out] LPWINDOWDATA pWinData); + + HRESULT LoadHistoryPosition( + [in] LPWSTR pszUrlLocation, + [in] DWORD dwPosition); +} diff --git a/reactos/lib/sdk/uuid/CMakeLists.txt b/reactos/lib/sdk/uuid/CMakeLists.txt index 4a620f65c36..90d65714ab6 100644 --- a/reactos/lib/sdk/uuid/CMakeLists.txt +++ b/reactos/lib/sdk/uuid/CMakeLists.txt @@ -126,7 +126,7 @@ list(APPEND IDL_SOURCES # termmgr.idl textstor.idl # tlog.idl -# tlogstg.idl + tlogstg.idl # trkadm.idl # trkcom.idl unknwn.idl