Commit 52f6a33a authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Cannot use put_nodeValue on a IXMLDOMProcessingInstruction node whose target is xml.

parent 442f29ab
......@@ -200,6 +200,25 @@ static HRESULT WINAPI dom_pi_put_nodeValue(
VARIANT var1 )
{
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
BSTR sTarget;
static WCHAR szXML[] = {'x','m','l',0};
HRESULT hr;
TRACE("%p\n", This );
/* Cannot set data to a PI node whos target is 'xml' */
hr = dom_pi_get_nodeName(iface, &sTarget);
if(hr == S_OK)
{
if(lstrcmpW( sTarget, szXML) == 0)
{
SysFreeString(sTarget);
return E_FAIL;
}
SysFreeString(sTarget);
}
return IXMLDOMNode_put_nodeValue( This->node, var1 );
}
......
......@@ -786,6 +786,13 @@ static void test_domdoc( void )
r = IXMLDOMProcessingInstruction_put_data(nodePI, _bstr_("version=\"1.0\" encoding=\"UTF-8\""));
ok(r == E_FAIL, "ret %08x\n", r );
/* test put_data */
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = SysAllocString(szOpen); /* Doesnt matter what the string is, cannot set an xml node. */
r = IXMLDOMProcessingInstruction_put_nodeValue(nodePI, var);
ok(r == E_FAIL, "ret %08x\n", r );
VariantClear(&var);
/* test get nodeName */
r = IXMLDOMProcessingInstruction_get_nodeName(nodePI, &str);
ok( !lstrcmpW( str, _bstr_("xml") ), "incorrect nodeName string\n");
......
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