>From 7dbd36c79a2c73e77d3d618b0ac07209034d6aa9 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Mon, 14 Nov 2011 14:31:11 +0300
Subject: [PATCH 6/7] Return qualified name from get_nodeName()

---
 dlls/msxml3/node.c         |   27 ++++++++++++++++++++++++---
 dlls/msxml3/tests/domdoc.c |    4 ++--
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index 19c91f5..6d9d0ce 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -128,12 +128,33 @@ xmlnode *get_node_obj(IXMLDOMNode *node)
 
 HRESULT node_get_nodeName(xmlnode *This, BSTR *name)
 {
+    BSTR prefix, base;
+    HRESULT hr;
+
     if (!name)
         return E_INVALIDARG;
 
-    *name = bstr_from_xmlChar(This->node->name);
-    if (!*name)
-        return S_FALSE;
+    hr = node_get_base_name(This, &base);
+    if (hr != S_OK) return hr;
+
+    hr = node_get_prefix(This, &prefix);
+    if (hr == S_OK)
+    {
+        static const WCHAR colW = ':';
+        WCHAR *ptr;
+
+        /* +1 for ':' */
+        ptr = *name = SysAllocStringLen(NULL, SysStringLen(base) + SysStringLen(prefix) + 1);
+        memcpy(ptr, prefix, SysStringByteLen(prefix));
+        ptr += SysStringLen(prefix);
+        memcpy(ptr++, &colW, sizeof(WCHAR));
+        memcpy(ptr, base, SysStringByteLen(base));
+
+        SysFreeString(base);
+        SysFreeString(prefix);
+    }
+    else
+        *name = base;
 
     return S_OK;
 }
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 699382f..3999b95 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -7009,7 +7009,7 @@ static void test_namespaces(void)
 
         hr = IXMLDOMNode_get_nodeName(node2, &str);
         EXPECT_HR(hr, S_OK);
-        todo_wine ok(!lstrcmpW( str, _bstr_("Model:Package")), "got %s\n", wine_dbgstr_w(str));
+        ok(!lstrcmpW( str, _bstr_("Model:Package")), "got %s\n", wine_dbgstr_w(str));
         SysFreeString(str);
 
         /* Test get_namespaceURI */
@@ -7030,7 +7030,7 @@ static void test_namespaces(void)
 
         hr = IXMLDOMAttribute_get_nodeName(attr, &str);
         EXPECT_HR(hr, S_OK);
-        todo_wine ok(!lstrcmpW( str, _bstr_("Model:name2")), "got %s\n", wine_dbgstr_w(str));
+        ok(!lstrcmpW( str, _bstr_("Model:name2")), "got %s\n", wine_dbgstr_w(str));
         SysFreeString(str);
 
         hr = IXMLDOMAttribute_get_prefix(attr, &str);
-- 
1.5.6.5


