Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/ieframe/oleobject.c | 9 ++++++--- dlls/ieframe/tests/webbrowser.c | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/dlls/ieframe/oleobject.c b/dlls/ieframe/oleobject.c index 5c49845aa7..28ead0f687 100644 --- a/dlls/ieframe/oleobject.c +++ b/dlls/ieframe/oleobject.c @@ -719,11 +719,14 @@ static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface) return E_NOTIMPL; }
-static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID* pClsid) +static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid) { WebBrowser *This = impl_from_IOleObject(iface); - FIXME("(%p)->(%p)\n", This, pClsid); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, pClsid); + + *pClsid = This->version == 1 ? CLSID_WebBrowser_V1: CLSID_WebBrowser; + return S_OK; }
static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c index 95d5fc4988..3ec5921a32 100644 --- a/dlls/ieframe/tests/webbrowser.c +++ b/dlls/ieframe/tests/webbrowser.c @@ -2227,7 +2227,7 @@ static void test_Persist(IWebBrowser2 *wb, int version) HRESULT hr;
hr = IWebBrowser2_QueryInterface(wb, &IID_IPersist, (void **)&persist); - ok(hr == S_OK, "QueryInterface(IID_IPersist failed: %08x\n", hr); + ok(hr == S_OK, "QueryInterface(IID_IPersist) failed: %08x\n", hr);
hr = IPersist_GetClassID(persist, &guid); ok(hr == S_OK, "GetClassID failed: %08x\n", hr); @@ -2239,6 +2239,25 @@ static void test_Persist(IWebBrowser2 *wb, int version) IPersist_Release(persist); }
+static void test_OleObject(IWebBrowser2 *wb, int version) +{ + IOleObject *oleobj; + CLSID clsid; + HRESULT hr; + + hr = IWebBrowser2_QueryInterface(wb, &IID_IOleObject, (void **)&oleobj); + ok(hr == S_OK, "QueryInterface(IID_IOleObject) failed: %08x\n", hr); + + hr = IOleObject_GetUserClassID(oleobj, &clsid); + ok(hr == S_OK, "GetUserClassID failed: %08x\n", hr); + if (version == 1) + ok(IsEqualGUID(&clsid, &CLSID_WebBrowser_V1), "got wrong CLSID: %s\n", wine_dbgstr_guid(&clsid)); + else + ok(IsEqualGUID(&clsid, &CLSID_WebBrowser), "got wrong CLSID: %s\n", wine_dbgstr_guid(&clsid)); + + IOleObject_Release(oleobj); +} + static void test_ie_funcs(IWebBrowser2 *wb) { IDispatch *disp; @@ -3761,6 +3780,7 @@ static void test_WebBrowser(DWORD flags, BOOL do_close) test_Navigate2(webbrowser, L"about:blank"); test_QueryStatusWB(webbrowser, TRUE); test_Persist(webbrowser, 2); + test_OleObject(webbrowser, 2);
if(do_download) { IHTMLDocument2 *doc, *doc2; @@ -3870,6 +3890,7 @@ static void test_WebBrowserV1(void) test_ClassInfo(wb); test_EnumVerbs(wb); test_Persist(wb, 1); + test_OleObject(wb, 1);
ref = IWebBrowser2_Release(wb); ok(ref == 0, "ref=%d, expected 0\n", ref);