>From 3fc004fb348e5a3c879b7b46e216411f713f4353 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Sun, 27 Nov 2011 22:36:32 +0300
Subject: [PATCH 4/4] Fix get_namespaceURI() for document nodes

---
 dlls/msxml3/domdoc.c       |    4 +---
 dlls/msxml3/tests/domdoc.c |   11 ++++++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 4640e62..68f47a7 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -1369,17 +1369,15 @@ static HRESULT WINAPI domdoc_get_parsed(
     return S_OK;
 }
 
-
 static HRESULT WINAPI domdoc_get_namespaceURI(
     IXMLDOMDocument3 *iface,
     BSTR* namespaceURI )
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
     TRACE("(%p)->(%p)\n", This, namespaceURI);
-    return node_get_namespaceURI(&This->node, namespaceURI);
+    return return_null_bstr( namespaceURI );
 }
 
-
 static HRESULT WINAPI domdoc_get_prefix(
     IXMLDOMDocument3 *iface,
     BSTR* prefix )
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 89eb1f6..b2a229b 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -7137,6 +7137,11 @@ static void test_namespaces(void)
     EXPECT_HR(hr, S_OK);
     ok(b == VARIANT_TRUE, "got %d\n", b);
 
+    str = (BSTR)0xdeadbeef;
+    hr = IXMLDOMDocument_get_namespaceURI(doc, &str);
+    EXPECT_HR(hr, S_FALSE);
+    ok(str == NULL, "got %p\n", str);
+
     hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("//XMI.content"), &node );
     EXPECT_HR(hr, S_OK);
     if(hr == S_OK)
@@ -8757,11 +8762,11 @@ static void test_get_prefix(void)
     /* 1. document */
     str = (void*)0xdeadbeef;
     hr = IXMLDOMDocument_get_prefix(doc, &str);
-    ok( hr == S_FALSE, "got 0x%08x\n", hr);
-    ok( str == 0, "got %p\n", str);
+    EXPECT_HR(hr, S_FALSE);
+    ok(str == NULL, "got %p\n", str);
 
     hr = IXMLDOMDocument_get_prefix(doc, NULL);
-    ok( hr == E_INVALIDARG, "got 0x%08x\n", hr);
+    EXPECT_HR(hr, E_INVALIDARG);
 
     /* 2. cdata */
     hr = IXMLDOMDocument_createCDATASection(doc, NULL, &cdata);
-- 
1.5.6.5


