msxml3: Cannot use put_nodeValue on a IXMLDOMProcessingInstruction node whose target is xml.
This commit is contained in:
parent
442f29ab49
commit
52f6a33a85
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue