Alistair Leslie-Hughes : msxml3: Correct createElement return value for an invalid type.

Alexandre Julliard julliard at winehq.org
Mon Feb 4 08:43:15 CST 2008


Module: wine
Branch: master
Commit: c9f5f2c6a29f674f90f8f94f4b5bbb3db0439dd4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c9f5f2c6a29f674f90f8f94f4b5bbb3db0439dd4

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Feb  1 21:25:37 2008 +1100

msxml3: Correct createElement return value for an invalid type.

---

 dlls/msxml3/tests/xmldoc.c |    4 ++--
 dlls/msxml3/xmldoc.c       |    3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/msxml3/tests/xmldoc.c b/dlls/msxml3/tests/xmldoc.c
index 1186c9b..89c73cf 100644
--- a/dlls/msxml3/tests/xmldoc.c
+++ b/dlls/msxml3/tests/xmldoc.c
@@ -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)
     {
diff --git a/dlls/msxml3/xmldoc.c b/dlls/msxml3/xmldoc.c
index a4c0850..ee72d1b 100644
--- a/dlls/msxml3/xmldoc.c
+++ b/dlls/msxml3/xmldoc.c
@@ -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));
 




More information about the wine-cvs mailing list