Commit 47b6d3a1 authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

msxml3: Fix IXMLDOMNamedNodeMap_getNamedItem() conformance on error.

parent 4195697c
......@@ -165,7 +165,10 @@ static HRESULT WINAPI xmlnodemap_getNamedItem(
xmlAttrPtr attr;
xmlNodePtr node;
TRACE("%p %s\n", This, debugstr_w(name) );
TRACE("%p %s %p\n", This, debugstr_w(name), namedItem );
if ( !namedItem )
return E_INVALIDARG;
node = xmlNodePtr_from_domnode( This->node, 0 );
if ( !node )
......@@ -176,7 +179,10 @@ static HRESULT WINAPI xmlnodemap_getNamedItem(
HeapFree( GetProcessHeap(), 0, element_name );
if ( !attr )
return E_FAIL;
{
*namedItem = NULL;
return S_FALSE;
}
*namedItem = create_node( (xmlNodePtr) attr );
......
......@@ -396,6 +396,19 @@ todo_wine
IXMLDOMNode_Release(node);
SysFreeString( str );
str = SysAllocString( szdl );
r = IXMLDOMNamedNodeMap_getNamedItem( map, str, NULL );
ok( r == E_INVALIDARG, "getNamedItem should return E_INVALIDARG\n");
SysFreeString( str );
/* something that isn't in szComplete4 */
str = SysAllocString( szOpen );
node = (IXMLDOMNode *) 1;
r = IXMLDOMNamedNodeMap_getNamedItem( map, str, &node );
ok( r = S_FALSE, "getNamedItem found a node that wasn't there\n");
ok( node == NULL, "getNamedItem should have returned NULL\n");
SysFreeString( str );
/* test indexed access of attributes */
r = IXMLDOMNamedNodeMap_get_length( map, &count );
ok ( r == S_OK, "get_length wrong code\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment