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

msxml3: Correct IXMLDOMProcessingInstruction_put_data function.

parent ad606f4d
......@@ -506,9 +506,24 @@ static HRESULT WINAPI dom_pi_put_data(
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
HRESULT hr = E_FAIL;
VARIANT val;
BSTR sTarget;
static WCHAR szXML[] = {'x','m','l',0};
TRACE("%p %s\n", This, debugstr_w(data) );
/* 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);
}
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
......
......@@ -682,19 +682,7 @@ static void test_domdoc( void )
/* test put_data */
r = IXMLDOMProcessingInstruction_put_data(nodePI, _bstr_("version=\"1.0\" encoding=\"UTF-8\""));
ok(r == S_OK, "ret %08x\n", r );
SysFreeString(str);
r = IXMLDOMProcessingInstruction_get_data(nodePI, &str);
ok(r == S_OK, "ret %08x\n", r );
ok( !lstrcmpW( str, _bstr_("version=\"1.0\" encoding=\"UTF-8\"") ), "incorrect data string\n");
SysFreeString(str);
/* Confirm XML text is good */
r = IXMLDOMProcessingInstruction_get_xml(nodePI, &str);
ok(r == S_OK, "ret %08x\n", r );
ok( !lstrcmpW( str, _bstr_("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") ), "incorrect xml string\n");
SysFreeString(str);
ok(r == E_FAIL, "ret %08x\n", r );
IXMLDOMProcessingInstruction_Release(nodePI);
}
......
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