Commit 04288208 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Implement IXMLDocument::get_version().

parent b8729fda
......@@ -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");
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment