[PATCH 4/4] shell32: Add IShellBrowser stub to ExplorerBrowser.
David Hedberg
david.hedberg at gmail.com
Mon May 24 09:40:45 CDT 2010
Stub messages added.
---
dlls/shell32/ebrowser.c | 227 +++++++++++++++++++++++++++++++++++++++++
dlls/shell32/tests/ebrowser.c | 2 +-
2 files changed, 228 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/ebrowser.c b/dlls/shell32/ebrowser.c
index 4ddbb27..1ebd1b1 100644
--- a/dlls/shell32/ebrowser.c
+++ b/dlls/shell32/ebrowser.c
@@ -35,9 +35,15 @@ WINE_DEFAULT_DEBUG_CHANNEL (ebrowser);
typedef struct {
const IExplorerBrowserVtbl *lpEBVtbl;
+ const IShellBrowserVtbl *lpSBVtbl;
LONG ref;
} ExplorerBrowserImpl;
+static inline ExplorerBrowserImpl *impl_from_IShellBrowser(IShellBrowser *iface)
+{
+ return (ExplorerBrowserImpl *)((char*)iface - FIELD_OFFSET(ExplorerBrowserImpl, lpSBVtbl));
+}
+
/**************************************************************************
* IExplorerBrowser Implementation
*/
@@ -49,6 +55,8 @@ static HRESULT WINAPI IExplorerBrowser_fnQueryInterface(IExplorerBrowser *iface,
*ppvObject = NULL;
if(IsEqualGUID(riid, &IID_IExplorerBrowser)) {
*ppvObject = This;
+ } else if(IsEqualGUID(riid, &IID_IShellBrowser)) {
+ *ppvObject = &This->lpSBVtbl;
}
if(*ppvObject) {
@@ -269,6 +277,224 @@ static const IExplorerBrowserVtbl vt_IExplorerBrowser =
IExplorerBrowser_fnGetCurrentView
};
+/**************************************************************************
+* IShellBrowser Implementation
+*/
+
+static HRESULT WINAPI IShellBrowser_fnQueryInterface(
+ IShellBrowser *iface,
+ REFIID riid,
+ void **ppvObject)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ TRACE("This: %p\n", This);
+ return IUnknown_QueryInterface((IUnknown*) This, riid, ppvObject);
+}
+
+static ULONG WINAPI IShellBrowser_fnAddRef(IShellBrowser *iface)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ TRACE("This: %p\n", This);
+ return IUnknown_AddRef((IUnknown*) This);
+}
+
+static ULONG WINAPI IShellBrowser_fnRelease(IShellBrowser *iface)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ TRACE("This: %p\n", This);
+ return IUnknown_Release((IUnknown*) This);
+}
+
+static HRESULT WINAPI IShellBrowser_fnGetWindow(
+ IShellBrowser *iface,
+ HWND *phwnd)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnContextSensitiveHelp(
+ IShellBrowser *iface,
+ BOOL fEnterMode)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnInsertMenusSB(
+ IShellBrowser *iface,
+ HMENU hmenuShared,
+ LPOLEMENUGROUPWIDTHS lpMenuWidths)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnSetMenuSB(
+ IShellBrowser *iface,
+ HMENU hmenuShared,
+ HOLEMENU holemenuReserved,
+ HWND hwndActiveObject)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnRemoveMenusSB(
+ IShellBrowser *iface,
+ HMENU hmenuShared)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnSetStatusTextSB(
+ IShellBrowser *iface,
+ LPCOLESTR pszStatusText)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnEnableModelessSB(
+ IShellBrowser *iface,
+ BOOL fEnable)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnTranslateAcceleratorSB(
+ IShellBrowser *iface,
+ MSG *pmsg,
+ WORD wID)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnBrowseObject(
+ IShellBrowser *iface,
+ LPCITEMIDLIST pidl,
+ UINT wFlags)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnGetViewStateStream(
+ IShellBrowser *iface,
+ DWORD grfMode,
+ IStream **ppStrm)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ *ppStrm = NULL;
+ return E_FAIL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnGetControlWindow(
+ IShellBrowser *iface,
+ UINT id,
+ HWND *phwnd)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ *phwnd = NULL;
+ return E_FAIL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnSendControlMsg(
+ IShellBrowser *iface,
+ UINT id,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam,
+ LRESULT *pret)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnQueryActiveShellView(
+ IShellBrowser *iface,
+ IShellView **ppshv)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ *ppshv = NULL;
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnOnViewWindowActive(
+ IShellBrowser *iface,
+ IShellView *pshv)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IShellBrowser_fnSetToolbarItems(
+ IShellBrowser *iface,
+ LPTBBUTTONSB lpButtons,
+ UINT nButtons,
+ UINT uFlags)
+{
+ ExplorerBrowserImpl *This = impl_from_IShellBrowser(iface);
+ FIXME("Stub, This: %p\n", This);
+
+ return E_NOTIMPL;
+}
+
+static const IShellBrowserVtbl vt_IShellBrowser = {
+ /* IUnknown methods */
+ IShellBrowser_fnQueryInterface,
+ IShellBrowser_fnAddRef,
+ IShellBrowser_fnRelease,
+ /* IOleWindow methods */
+ IShellBrowser_fnGetWindow,
+ IShellBrowser_fnContextSensitiveHelp,
+ /* IShellBrowser methods */
+ IShellBrowser_fnInsertMenusSB,
+ IShellBrowser_fnSetMenuSB,
+ IShellBrowser_fnRemoveMenusSB,
+ IShellBrowser_fnSetStatusTextSB,
+ IShellBrowser_fnEnableModelessSB,
+ IShellBrowser_fnTranslateAcceleratorSB,
+ IShellBrowser_fnBrowseObject,
+ IShellBrowser_fnGetViewStateStream,
+ IShellBrowser_fnGetControlWindow,
+ IShellBrowser_fnSendControlMsg,
+ IShellBrowser_fnQueryActiveShellView,
+ IShellBrowser_fnOnViewWindowActive,
+ IShellBrowser_fnSetToolbarItems
+};
+
HRESULT WINAPI ExplorerBrowser_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv) {
ExplorerBrowserImpl *eb;
@@ -282,6 +508,7 @@ HRESULT WINAPI ExplorerBrowser_Constructor(IUnknown *pUnkOuter, REFIID riid, LPV
eb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ExplorerBrowserImpl));
eb->ref = 1;
eb->lpEBVtbl = &vt_IExplorerBrowser;
+ eb->lpSBVtbl = &vt_IShellBrowser;
*ppv = eb;
diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c
index 323f0dd..c548574 100644
--- a/dlls/shell32/tests/ebrowser.c
+++ b/dlls/shell32/tests/ebrowser.c
@@ -88,7 +88,7 @@ static void test_supported_interfaces(void) {
/* Test getting different interfaces */
hres = IExplorerBrowser_QueryInterface(lpEB, &IID_IShellBrowser, (LPVOID*)&lpUnk);
- todo_wine { ok(hres == S_OK, "got (0x%08x)\n", hres); }
+ ok(hres == S_OK, "got (0x%08x)\n", hres);
if(SUCCEEDED(hres)) {
lres = IUnknown_Release(lpUnk);
--
1.7.1
More information about the wine-patches
mailing list