msxml3: Implement IXMLDocument::get_version().

This commit is contained in:
Nikolay Sivov 2010-01-10 21:08:21 +03:00 committed by Alexandre Julliard
parent b8729fdade
commit 04288208d0
2 changed files with 18 additions and 2 deletions

View File

@ -70,6 +70,7 @@ static void test_xmldoc(void)
static const WCHAR szNumVal[] = {'1','2','3','4',0};
static const WCHAR szName[] = {'N','A','M','E',0};
static const WCHAR szNameVal[] = {'C','a','p','t','a','i','n',' ','A','h','a','b',0};
static const WCHAR szVersion[] = {'1','.','0',0};
hr = CoCreateInstance(&CLSID_XMLDocument, NULL, CLSCTX_INPROC_SERVER,
&IID_IXMLDocument, (LPVOID*)&doc);
@ -115,6 +116,15 @@ static void test_xmldoc(void)
ok(stream != NULL, "Expected non-NULL stream\n");
/* version field */
hr = IXMLDocument_get_version(doc, NULL);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
hr = IXMLDocument_get_version(doc, &name);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(!lstrcmpW(name, szVersion), "Expected 1.0, got %s\n", wine_dbgstr_w(name));
SysFreeString(name);
hr = IXMLDocument_get_root(doc, &element);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok(element != NULL, "Expected non-NULL element\n");

View File

@ -439,8 +439,14 @@ static HRESULT WINAPI xmldoc_put_charset(IXMLDocument *iface, BSTR p)
static HRESULT WINAPI xmldoc_get_version(IXMLDocument *iface, BSTR *p)
{
FIXME("(%p, %p): stub\n", iface, p);
return E_NOTIMPL;
xmldoc *This = impl_from_IXMLDocument(iface);
TRACE("(%p, %p)\n", This, p);
if (!p) return E_INVALIDARG;
*p = bstr_from_xmlChar(This->xmldoc->version);
return S_OK;
}
static HRESULT WINAPI xmldoc_get_doctype(IXMLDocument *iface, BSTR *p)