Commit 83300893 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Corrected getAttribute to return current value and assign output var.

parent b57a7e01
......@@ -459,15 +459,20 @@ static HRESULT WINAPI domelem_getAttribute(
domelem *This = impl_from_IXMLDOMElement( iface );
xmlNodePtr element;
xmlChar *xml_name, *xml_value;
HRESULT hr = E_FAIL;
HRESULT hr = S_FALSE;
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(name), value);
if(!value || !name)
return E_INVALIDARG;
element = get_element( This );
if ( !element )
return E_FAIL;
VariantInit(value);
V_BSTR(value) = NULL;
V_VT(value) = VT_NULL;
xml_name = xmlChar_from_wchar( name );
xml_value = xmlGetNsProp(element, xml_name, NULL);
HeapFree(GetProcessHeap(), 0, xml_name);
......
......@@ -697,8 +697,8 @@ static void test_domnode( void )
V_VT(&var) = VT_I4;
V_I4(&var) = 0x1234;
r = IXMLDOMElement_getAttribute( element, str, &var );
ok( r == E_FAIL, "getAttribute ret %08x\n", r );
ok( V_VT(&var) == VT_EMPTY, "vt = %x\n", V_VT(&var));
ok( r == S_FALSE, "getAttribute ret %08x\n", r );
ok( V_VT(&var) == VT_NULL, "vt = %x\n", V_VT(&var));
VariantClear(&var);
SysFreeString( str );
......@@ -710,6 +710,13 @@ static void test_domnode( void )
ok( V_VT(&var) == VT_BSTR, "vt = %x\n", V_VT(&var));
ok( !lstrcmpW(V_BSTR(&var), szstr1), "wrong attr value\n");
VariantClear( &var );
r = IXMLDOMElement_getAttribute( element, NULL, &var );
ok( r == E_INVALIDARG, "getAttribute ret %08x\n", r );
r = IXMLDOMElement_getAttribute( element, str, NULL );
ok( r == E_INVALIDARG, "getAttribute ret %08x\n", r );
SysFreeString( str );
r = IXMLDOMElement_get_attributes( element, &map );
......
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