Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/msxml3/pi.c | 45 +++++++++++++++++++++++++++++++++++--- dlls/msxml3/tests/domdoc.c | 5 ----- 2 files changed, 42 insertions(+), 8 deletions(-)
diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index fe291e72af8..59ceee767a1 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -813,6 +813,27 @@ static const struct IXMLDOMProcessingInstructionVtbl dom_pi_vtbl = dom_pi_put_data };
+static xmlAttrPtr node_has_prop(const xmlNode *node, const xmlChar *name) +{ + xmlAttrPtr prop; + + /* xmlHasNsProp accepts only nodes of type XML_ELEMENT_NODE, + * so we have to look for an attribute in the node by hand. + */ + + prop = node->properties; + + while (prop) + { + if (xmlStrEqual(prop->name, name)) + return prop; + + prop = prop->next; + } + + return NULL; +} + static HRESULT dom_pi_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR uri, IXMLDOMNode **item) { @@ -822,10 +843,28 @@ static HRESULT dom_pi_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR
static HRESULT dom_pi_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMNode **item) { - FIXME("(%p)->(%s %p): stub\n", node, debugstr_w(name), item ); - if (item) + xmlChar *nameA; + xmlAttrPtr attr; + + TRACE("(%p)->(%s %p)\n", node, debugstr_w(name), item); + + if (!item) return E_POINTER; + + nameA = xmlchar_from_wchar(name); + if (!nameA) return E_OUTOFMEMORY; + + attr = node_has_prop(node, nameA); + heap_free(nameA); + + if (!attr) + { *item = NULL; - return S_FALSE; + return S_FALSE; + } + + *item = create_node((xmlNodePtr)attr); + + return S_OK; }
static HRESULT dom_pi_set_named_item(xmlNodePtr node, IXMLDOMNode *newItem, IXMLDOMNode **namedItem) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 59a8a243c87..39355034d97 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -8579,13 +8579,9 @@ todo_wine
item = NULL; hr = IXMLDOMNamedNodeMap_getNamedItem(node_map, _bstr_("encoding"), &item); -todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine ok(item != NULL, "got NULL\n");
-if (hr == S_OK) -{ hr = IXMLDOMNode_get_nodeName(item, &bstr); ok(hr == S_OK, "got 0x%08x\n", hr); ok(!lstrcmpW(bstr, L"encoding"), "got %s\n", wine_dbgstr_w(bstr)); @@ -8597,7 +8593,6 @@ if (hr == S_OK) ok(V_VT(&var) == VT_BSTR, "got %u\n", V_VT(&var)); ok(!lstrcmpW(V_BSTR(&var), L"windows-1252"), "got %s\n", wine_dbgstr_w(V_BSTR(&var))); VariantClear(&var); -}
IXMLDOMNamedNodeMap_Release(node_map); IXMLDOMNode_Release(node);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=89408
Your paranoid android.
=== wvistau64 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w2008s64 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w864 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w1064v1507 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w1064v1809 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w1064 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w1064_2qxl (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w10pro64 (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w10pro64_ar (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w10pro64_he (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w10pro64_ja (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)
=== w10pro64_zh_CN (64 bit report) ===
Report validation errors: msxml3:domdoc crashed (c0000374)