Nikolay Sivov : msxml3: IXMLDOMAttribute shouldn't report its parent.
Alexandre Julliard
julliard at winehq.org
Wed Feb 10 10:44:50 CST 2010
Module: wine
Branch: master
Commit: f65fd26fe1727caab28b9453da32925a9d1b78b2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f65fd26fe1727caab28b9453da32925a9d1b78b2
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Tue Feb 9 21:00:25 2010 +0300
msxml3: IXMLDOMAttribute shouldn't report its parent.
---
dlls/msxml3/attribute.c | 5 ++++-
dlls/msxml3/tests/domdoc.c | 13 ++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c
index 04b8c46..22364f3 100644
--- a/dlls/msxml3/attribute.c
+++ b/dlls/msxml3/attribute.c
@@ -213,7 +213,10 @@ static HRESULT WINAPI domattr_get_parentNode(
IXMLDOMNode** parent )
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
- return IXMLDOMNode_get_parentNode( IXMLDOMNode_from_impl(&This->node), parent );
+ TRACE("(%p)->(%p)\n", This, parent);
+ if (!parent) return E_INVALIDARG;
+ *parent = NULL;
+ return S_FALSE;
}
static HRESULT WINAPI domattr_get_childNodes(
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 3c5c53c..0c847e5 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -1216,8 +1216,19 @@ static void test_domnode( void )
r = IXMLDOMElement_getAttributeNode( element, str, &attr);
ok( r == S_OK, "GetAttributeNode ret %08x\n", r );
ok( attr != NULL, "getAttributeNode returned NULL\n" );
- if(attr)
+ if (attr)
+ {
+ r = IXMLDOMAttribute_get_parentNode( attr, NULL );
+ ok( r == E_INVALIDARG, "Expected E_INVALIDARG, ret %08x\n", r );
+
+ /* attribute doesn't have a parent in msxml interpretation */
+ node = (IXMLDOMNode*)0xdeadbeef;
+ r = IXMLDOMAttribute_get_parentNode( attr, &node );
+ ok( r == S_FALSE, "Expected S_FALSE, ret %08x\n", r );
+ ok( node == NULL, "Expected NULL, got %p\n", node );
+
IXMLDOMAttribute_Release(attr);
+ }
SysFreeString( str );
More information about the wine-cvs
mailing list