diff --git a/dlls/msxml3/schema.c b/dlls/msxml3/schema.c index 5bfabb30718..2b2882ce7da 100644 --- a/dlls/msxml3/schema.c +++ b/dlls/msxml3/schema.c @@ -1292,11 +1292,17 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri TRACE("(%p)->(%s %p)\n", This, debugstr_w(uri), node); - if (This->version == MSXML6) return E_NOTIMPL; + if (This->version == MSXML6) + { + if (node) *node = NULL; + return E_NOTIMPL; + } if (!node) return E_POINTER; + *node = NULL; + name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW); entry = (cache_entry*) xmlHashLookup(This->cache, name); heap_free(name); @@ -1305,7 +1311,6 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri if (entry && entry->doc) return get_domdoc_from_xmldoc(entry->doc, (IXMLDOMDocument3**)node); - *node = NULL; return S_OK; } @@ -1344,6 +1349,9 @@ static HRESULT WINAPI schema_cache_get_namespaceURI(IXMLDOMSchemaCollection2* if if (!uri) return E_POINTER; + if (This->version == MSXML6) + *uri = NULL; + if (index >= This->count) return E_FAIL; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 79805cc010f..dd40133cc67 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -10382,7 +10382,8 @@ static void test_dispex(void) hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); +todo_wine + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); V_VT(&arg) = VT_I4; V_I4(&arg) = 0; @@ -10396,7 +10397,8 @@ static void test_dispex(void) hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); +todo_wine + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); V_VT(&arg) = VT_I4; V_I4(&arg) = 0; @@ -10448,7 +10450,8 @@ static void test_dispex(void) hr = IDispatchEx_Invoke(dispex, DISPID_DOM_NODELIST_LENGTH, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1, "got %d\n", V_I4(&ret)); +todo_wine + ok(broken(V_I4(&ret) == 1) || (V_I4(&ret) == 0), "got %d\n", V_I4(&ret)); IXMLDOMNodeList_Release(node_list); @@ -10473,7 +10476,8 @@ static void test_dispex(void) hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); +todo_wine + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); IDispatchEx_Release(dispex); @@ -10547,8 +10551,9 @@ static void test_dispex(void) todo_wine { ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); } + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); + V_VT(&arg) = VT_I4; V_I4(&arg) = 0; dispparams.cArgs = 2; @@ -10562,8 +10567,9 @@ todo_wine { todo_wine { ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); } + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); + V_VT(&arg) = VT_I4; V_I4(&arg) = 0; dispparams.cArgs = 1; @@ -10614,10 +10620,10 @@ todo_wine V_I4(&ret) = 1; hr = IDispatchEx_Invoke(dispex, DISPID_DOM_NODELIST_LENGTH, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr); -todo_wine { +todo_wine ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1, "got %d\n", V_I4(&ret)); -} + ok(broken(V_I4(&ret) == 1) || (V_I4(&ret) == 0), "got %d\n", V_I4(&ret)); + IXMLDOMNamedNodeMap_Release(map); IXMLDOMElement_Release(elem); @@ -11265,7 +11271,7 @@ static void test_get_namespaces(void) node = (void*)0xdeadbeef; hr = IXMLDOMSchemaCollection_get(collection, _bstr_("http://blah.org"), &node); EXPECT_HR(hr, E_NOTIMPL); - ok(node == (void*)0xdeadbeef, "got %p\n", node); + ok(broken(node == (void*)0xdeadbeef) || (node == NULL), "got %p\n", node); /* load schema and try to add it */ doc2 = create_document(&IID_IXMLDOMDocument2); @@ -11291,7 +11297,7 @@ static void test_get_namespaces(void) s = (void*)0xdeadbeef; hr = IXMLDOMSchemaCollection_get_namespaceURI(collection, 2, &s); EXPECT_HR(hr, E_FAIL); - ok(s == (void*)0xdeadbeef, "got %p\n", s); + ok(broken(s == (void*)0xdeadbeef) || (s == NULL), "got %p\n", s); /* enumerate */ enumv = (void*)0xdeadbeef;