From c97d498f400e3c4ef780433b2783063a363c9a7e Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 13 Oct 2008 14:51:42 -0500 Subject: [PATCH] mshtml: Added IOmNavigator::get_appVersion implementation. --- dlls/mshtml/omnavigator.c | 17 +++++++++++++++-- dlls/mshtml/tests/dom.c | 10 +++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 32bd9bf7493..9ea6df83dfb 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -146,8 +146,21 @@ static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p) static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p) { OmNavigator *This = OMNAVIGATOR_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + /* FIXME: Should we return something smarter? */ + static const WCHAR app_verW[] = + {'4','.','0',' ','(','c','o','m','p','a','t','i','b','l','e',';', + ' ','M','S','I','E',' ','7','.','0',';', + ' ','W','i','n','d','o','w','s',' ','N','T',' ','5','.','1',';', + ' ','M','o','z','i','l','l','a','/','4','.','0',')',0}; + + TRACE("(%p)->(%p)\n", This, p); + + *p = SysAllocString(app_verW); + if(!*p) + return E_OUTOFMEMORY; + + return S_OK; } static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index f2252a1241d..438804808fc 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2152,6 +2152,8 @@ static void test_navigator(IHTMLDocument2 *doc) BSTR bstr; HRESULT hres; + static const WCHAR v40[] = {'4','.','0'}; + hres = IHTMLDocument2_get_parentWindow(doc, &window); ok(hres == S_OK, "parentWidnow failed: %08x\n", hres); @@ -2174,10 +2176,16 @@ static void test_navigator(IHTMLDocument2 *doc) bstr = NULL; hres = IOmNavigator_get_platform(navigator, &bstr); - ok(hres == S_OK, "get_appMinorVersion failed: %08x\n", hres); + ok(hres == S_OK, "get_platform failed: %08x\n", hres); ok(!strcmp_wa(bstr, "Win32"), "unexpected platform %s\n", dbgstr_w(bstr)); SysFreeString(bstr); + bstr = NULL; + hres = IOmNavigator_get_appVersion(navigator, &bstr); + ok(hres == S_OK, "get_appVersion failed: %08x\n", hres); + ok(!memcmp(bstr, v40, sizeof(v40)), "appVersion is %s\n", dbgstr_w(bstr)); + SysFreeString(bstr); + ref = IOmNavigator_Release(navigator); ok(!ref, "navigator should be destroyed here\n"); }