From 9c0260f2cb3e8a73e83b3a2ebdf7decfa62a6a14 Mon Sep 17 00:00:00 2001 From: David Hedberg Date: Mon, 23 Aug 2010 12:55:17 +0200 Subject: [PATCH] shell32: Implement IExplorerBrowser::SetOptions and IExplorerBrowser::GetOptions. --- dlls/shell32/ebrowser.c | 20 ++++++++++++++++---- dlls/shell32/tests/ebrowser.c | 26 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/ebrowser.c b/dlls/shell32/ebrowser.c index b2c4497fdc4..20b5363014a 100644 --- a/dlls/shell32/ebrowser.c +++ b/dlls/shell32/ebrowser.c @@ -42,6 +42,8 @@ typedef struct _ExplorerBrowserImpl { BOOL destroyed; HWND hwnd_main; + + EXPLORER_BROWSER_OPTIONS eb_options; } ExplorerBrowserImpl; /************************************************************************** @@ -258,18 +260,28 @@ static HRESULT WINAPI IExplorerBrowser_fnSetOptions(IExplorerBrowser *iface, EXPLORER_BROWSER_OPTIONS dwFlag) { ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface; - FIXME("stub, %p (0x%x)\n", This, dwFlag); + static const EXPLORER_BROWSER_OPTIONS unsupported_options = + EBO_SHOWFRAMES | EBO_ALWAYSNAVIGATE | EBO_NOWRAPPERWINDOW | EBO_HTMLSHAREPOINTVIEW; - return E_NOTIMPL; + TRACE("%p (0x%x)\n", This, dwFlag); + + if(dwFlag & unsupported_options) + FIXME("Flags 0x%08x contains unsupported options.\n", dwFlag); + + This->eb_options = dwFlag; + + return S_OK; } static HRESULT WINAPI IExplorerBrowser_fnGetOptions(IExplorerBrowser *iface, EXPLORER_BROWSER_OPTIONS *pdwFlag) { ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface; - FIXME("stub, %p (%p)\n", This, pdwFlag); + TRACE("%p (%p)\n", This, pdwFlag); - return E_NOTIMPL; + *pdwFlag = This->eb_options; + + return S_OK; } static HRESULT WINAPI IExplorerBrowser_fnBrowseToIDList(IExplorerBrowser *iface, diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c index be993ddf6eb..8486645ab8d 100644 --- a/dlls/shell32/tests/ebrowser.c +++ b/dlls/shell32/tests/ebrowser.c @@ -277,6 +277,7 @@ static void test_basics(void) IExplorerBrowser *peb; IShellBrowser *psb; ULONG lres; + DWORD flags; HDWP hdwp; RECT rc; HRESULT hr; @@ -331,6 +332,31 @@ static void test_basics(void) IShellBrowser_Release(psb); } + IExplorerBrowser_Destroy(peb); + IExplorerBrowser_Release(peb); + + /* GetOptions/SetOptions*/ + ebrowser_instantiate(&peb); + + if(0) { + /* Crashes on Windows 7 */ + IExplorerBrowser_GetOptions(peb, NULL); + } + + hr = IExplorerBrowser_GetOptions(peb, &flags); + ok(hr == S_OK, "got (0x%08x)\n", hr); + ok(flags == 0, "got (0x%08x)\n", flags); + + /* Settings preserved through Initialize. */ + hr = IExplorerBrowser_SetOptions(peb, 0xDEADBEEF); + ok(hr == S_OK, "got (0x%08x)\n", hr); + + ebrowser_initialize(peb); + + hr = IExplorerBrowser_GetOptions(peb, &flags); + ok(flags == 0xDEADBEEF, "got (0x%08x)\n", flags); + ok(hr == S_OK, "got (0x%08x)\n", hr); + IExplorerBrowser_Destroy(peb); lres = IExplorerBrowser_Release(peb); ok(lres == 0, "Got %d\n", lres);