[PATCH] Implement IWebBrowser2_get_Name
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Fri Dec 4 05:49:29 CST 2009
---
dlls/shdocvw/tests/webbrowser.c | 14 ++++++++++++++
dlls/shdocvw/webbrowser.c | 10 ++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c
index 41b7c7d..fba30be 100644
--- a/dlls/shdocvw/tests/webbrowser.c
+++ b/dlls/shdocvw/tests/webbrowser.c
@@ -139,6 +139,13 @@ static IWebBrowser2 *wb;
static HWND container_hwnd, shell_embedding_hwnd;
static BOOL is_downloading = FALSE;
+static int strcmp_wa(LPCWSTR strw, const char *stra)
+{
+ CHAR buf[512];
+ WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
+ return lstrcmpA(stra, buf);
+}
+
static const char *debugstr_guid(REFIID riid)
{
static char buf[50];
@@ -1588,6 +1595,7 @@ static void test_ie_funcs(IUnknown *unk)
int i;
LONG hwnd;
HRESULT hres;
+ BSTR sName;
hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
@@ -1807,6 +1815,12 @@ static void test_ie_funcs(IUnknown *unk)
hres = IWebBrowser2_get_Application(wb, NULL);
ok(hres == E_POINTER, "get_Application failed: %08x, expected E_POINTER\n", hres);
+ /* Name */
+ hres = IWebBrowser2_get_Name(wb, &sName);
+ ok(hres == S_OK, "getName failed: %08x, expected S_OK\n", hres);
+ ok(!strcmp_wa(sName, "Microsoft Web Browser Control"), "got '%s', expected 'Microsoft Web Browser Control'\n", wine_dbgstr_w(sName));
+ SysFreeString(sName);
+
/* Quit */
hres = IWebBrowser2_Quit(wb);
diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c
index 1f2e149..6c3c671 100644
--- a/dlls/shdocvw/webbrowser.c
+++ b/dlls/shdocvw/webbrowser.c
@@ -530,9 +530,15 @@ static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szPropert
static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
{
+ static const WCHAR sName[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b',\
+ ' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0};
WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%p)\n", This, Name);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, Name);
+
+ *Name = SysAllocString(sName);
+
+ return S_OK;
}
static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
--
1.6.2.5
--------------080808010606090703040402--
More information about the wine-patches
mailing list