diff --git a/patches/msxml3-element_props/0001-msxml3-Correct-looping-of-Document-Element-propertie.patch b/patches/msxml3-element_props/0001-msxml3-Correct-looping-of-Document-Element-propertie.patch new file mode 100644 index 00000000..8eb159f4 --- /dev/null +++ b/patches/msxml3-element_props/0001-msxml3-Correct-looping-of-Document-Element-propertie.patch @@ -0,0 +1,97 @@ +From 2135156d666a6a7a779326b7f1fdcbd2a8d58c8a Mon Sep 17 00:00:00 2001 +From: Spencer Wallace +Date: Mon, 24 Feb 2025 13:33:18 -0800 +Subject: [PATCH] msxml3: Correct looping of Document Element properties. + +--- + dlls/msxml3/element.c | 2 ++ + dlls/msxml3/tests/domdoc.c | 53 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 55 insertions(+) + +diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c +index 0fe72dcef9c..3e3c2d06169 100644 +--- a/dlls/msxml3/element.c ++++ b/dlls/msxml3/element.c +@@ -1812,6 +1812,8 @@ static HRESULT domelem_get_item(const xmlNodePtr node, LONG index, IXMLDOMNode * + *item = create_node( (xmlNodePtr) curr ); + return S_OK; + } ++ ++ ++attrIndex; + } + + if (!node->nsDef) +diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c +index dcb83f781ba..84a1f330582 100644 +--- a/dlls/msxml3/tests/domdoc.c ++++ b/dlls/msxml3/tests/domdoc.c +@@ -10224,6 +10224,15 @@ static void test_get_attributes(void) + L"xmlns:dcterms", + L"xmlns:foaf" + }; ++ const WCHAR *attributes[] = ++ { ++ L"rdf:about", ++ L"dcterms:created", ++ L"xmlns:oslc_am", ++ L"xmlns:rdf", ++ L"xmlns:dcterms", ++ L"xmlns:foaf" ++ }; + const get_attributes_t *entry = get_attributes; + IXMLDOMNamedNodeMap *map; + IXMLDOMDocument *doc, *doc2; +@@ -10505,6 +10514,50 @@ static void test_get_attributes(void) + + IXMLDOMDocument_Release(doc); + ++ str = SysAllocString(L"" ++ L"" ++ L""); ++ ++ doc = create_document(&IID_IXMLDOMDocument2); ++ ++ hr = IXMLDOMDocument_loadXML(doc, str, &b); ++ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ++ ok(b == VARIANT_TRUE, "got %d\n", b); ++ ++ hr = IXMLDOMDocument_get_documentElement(doc, &elem); ++ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ++ ++ hr = IXMLDOMElement_get_attributes(elem, &map); ++ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ++ ++ length = -1; ++ hr = IXMLDOMNamedNodeMap_get_length(map, &length); ++ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ++ ok(length == 6, "length %#lx.\n", length); ++ ++ for(i=0; i < length; i++) ++ { ++ hr = IXMLDOMNamedNodeMap_get_item(map, i, &node2); ++ ok( hr == S_OK, "Unexpected hr %#lx (%ld).\n", hr, i); ++ ++ hr = IXMLDOMNode_get_nodeName(node2, &str); ++ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ++ ok(!lstrcmpW(str, attributes[i]), "got %s\n", wine_dbgstr_w(str)); ++ SysFreeString(str); ++ ++ IXMLDOMNode_Release(node2); ++ } ++ ++ IXMLDOMNamedNodeMap_Release(map); ++ IXMLDOMElement_Release(elem); ++ ++ IXMLDOMDocument_Release(doc); ++ + free_bstrs(); + } + +-- +2.47.2 +