Nikolay Sivov (@nsivov) commented about dlls/msxml3/element.c:
- HRESULT hr;
- BSTR attr_name;
- IXMLDOMNamedNodeMap* attr_map;
- TRACE("(%p)->(%p %p)\n", This, domAttribute, attributeNode);
- if (!domAttribute) {
return E_INVALIDARG;
- }
- /* check given node type to be an attribute */
- hr = IXMLDOMNode_get_nodeType((IXMLDOMNode *)domAttribute, &type);
- if (hr != S_OK) return hr;
- if (type != NODE_ATTRIBUTE) {
return E_INVALIDARG;
- }
I suspect it should be stricter and check that attribute node is actually has "this" as a parent (currently we can't easily check that using API, so it likely should be done and xmlNode level). This also should fix your S_FALSE -> E_INVALIDARG fixup.