msxml3: Correct createElement return value for an invalid type.

This commit is contained in:
Alistair Leslie-Hughes 2008-02-01 21:25:37 +11:00 committed by Alexandre Julliard
parent d4a4b12a43
commit c9f5f2c6a2
2 changed files with 5 additions and 2 deletions

View File

@ -270,8 +270,8 @@ static void test_createElement(void)
V_I4(&vType) = -1;
V_VT(&vName) = VT_NULL;
hr = IXMLDocument_createElement(doc, vType, vName, &element);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
ok(element != NULL, "Expected non-NULL element\n");
ok(hr == E_NOTIMPL, "Expected S_OK, got %d\n", hr);
ok(element == NULL, "Expected NULL element\n");
if (element != NULL)
{

View File

@ -453,6 +453,9 @@ static HRESULT WINAPI xmldoc_createElement(IXMLDocument *iface, VARIANT vType,
if (V_VT(&vType) != VT_I4)
return E_INVALIDARG;
if(type_msxml_to_libxml(V_I4(&vType)) == -1)
return E_NOTIMPL;
node = xmlNewNode(NULL, empty);
node->type = type_msxml_to_libxml(V_I4(&vType));