From cdac6b500543381a047301ea3f36bd1844059508 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 4 Jan 2008 09:15:00 +1100 Subject: [PATCH] msxml3: Cannot add an attribute with appendChild. --- dlls/msxml3/node.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 019f1d33704..c0fd27cc955 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -482,9 +482,29 @@ static HRESULT WINAPI xmlnode_appendChild( IXMLDOMNode** outNewChild) { xmlnode *This = impl_from_IXMLDOMNode( iface ); + IXMLDOMNode *pAttr = NULL; VARIANT var; TRACE("(%p)->(%p,%p)\n", This, newChild, outNewChild); + + /* Cannot Append an Attribute node. */ + IUnknown_QueryInterface(newChild, &IID_IXMLDOMNode, (LPVOID*)&pAttr); + if(pAttr) + { + xmlnode *ThisNew = impl_from_IXMLDOMNode( pAttr ); + + if(ThisNew->node->type == XML_ATTRIBUTE_NODE) + { + if(outNewChild) *outNewChild = NULL; + + IUnknown_Release(pAttr); + + return E_FAIL; + } + + IUnknown_Release(pAttr); + } + VariantInit(&var); return IXMLDOMNode_insertBefore(iface, newChild, var, outNewChild); }