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

msxml3: Accept VT_UNKNOWN input for IXMLDOMSchemaCollection::add().

parent aaac0db6
......@@ -1226,12 +1226,13 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
break;
case VT_DISPATCH:
case VT_UNKNOWN:
{
xmlDocPtr doc = NULL;
cache_entry* entry;
CacheEntryType type;
IXMLDOMNode* domnode = NULL;
IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IXMLDOMNode, (void**)&domnode);
IUnknown_QueryInterface(V_UNKNOWN(&var), &IID_IXMLDOMNode, (void**)&domnode);
if (domnode)
doc = xmlNodePtr_from_domnode(domnode, XML_DOCUMENT_NODE)->doc;
......@@ -1275,11 +1276,10 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
break;
default:
{
FIXME("arg type is not supported, %s\n", debugstr_variant(&var));
heap_free(name);
return E_INVALIDARG;
}
}
heap_free(name);
return S_OK;
}
......
......@@ -506,6 +506,7 @@ static void test_schema_refs(void)
VARIANT_BOOL b;
BSTR str;
LONG len;
HRESULT hr;
doc = create_document(&IID_IXMLDOMDocument2);
if (!doc)
......@@ -557,6 +558,24 @@ static void test_schema_refs(void)
ole_check(IXMLDOMSchemaCollection_get_length(cache, &len));
ok(len == 0, "got %d\n", len);
/* same, but with VT_UNKNOWN type */
V_VT(&v) = VT_UNKNOWN;
V_UNKNOWN(&v) = (IUnknown*)doc;
hr = IXMLDOMSchemaCollection_add(cache, NULL, v);
ok(hr == S_OK, "got 0x%08x\n", hr);
len = -1;
hr = IXMLDOMSchemaCollection_get_length(cache, &len);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(len == 1, "got %d\n", len);
hr = IXMLDOMSchemaCollection_remove(cache, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
len = -1;
hr = IXMLDOMSchemaCollection_get_length(cache, &len);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(len == 0, "got %d\n", len);
str = SysAllocString(xdr_schema_uri);
ole_check(IXMLDOMSchemaCollection_add(cache, str, _variantdoc_(doc)));
......
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