Module: wine Branch: master Commit: 5ab513bd9e8aa8532986e08c336095445c3e5f14 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5ab513bd9e8aa8532986e08c33...
Author: Adam Martinson amartinson@codeweavers.com Date: Mon Jun 20 00:25:12 2011 -0500
msxml3: Fix a couple incorrect uses of VariantChangeType().
---
dlls/msxml3/element.c | 16 +++++++++------- dlls/msxml3/httprequest.c | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 5071244..f84dcb5 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -761,21 +761,24 @@ static HRESULT WINAPI domelem_put_nodeTypedValue( VARIANT value) { domelem *This = impl_from_IXMLDOMElement( iface ); - VARIANT type; + XDR_DT dt; HRESULT hr;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
+ dt = element_get_dt(get_element(This)); /* for untyped node coerce to BSTR and set */ - if (IXMLDOMElement_get_dataType(iface, &type) == S_FALSE) + if (dt == DT_INVALID) { if (V_VT(&value) != VT_BSTR) { - hr = VariantChangeType(&value, &value, 0, VT_BSTR); + VARIANT content; + VariantInit(&content); + hr = VariantChangeType(&content, &value, 0, VT_BSTR); if (hr == S_OK) { - hr = node_set_content(&This->node, V_BSTR(&value)); - VariantClear(&value); + hr = node_set_content(&This->node, V_BSTR(&content)); + VariantClear(&content); } } else @@ -783,8 +786,7 @@ static HRESULT WINAPI domelem_put_nodeTypedValue( } else { - FIXME("not implemented for typed nodes. type %s\n", debugstr_w(V_BSTR(&value))); - VariantClear(&type); + FIXME("not implemented for dt:%s\n", dt_to_str(dt)); return E_NOTIMPL; }
diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index d49840f..4435951 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -666,7 +666,7 @@ static HRESULT WINAPI httprequest_open(IXMLHTTPRequest *iface, BSTR method, BSTR { httprequest *This = impl_from_IXMLHTTPRequest( iface ); HRESULT hr; - VARIANT str; + VARIANT str, is_async;
TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(method), debugstr_w(url), debugstr_variant(&async)); @@ -700,8 +700,9 @@ static HRESULT WINAPI httprequest_open(IXMLHTTPRequest *iface, BSTR method, BSTR
This->url = SysAllocString(url);
- hr = VariantChangeType(&async, &async, 0, VT_BOOL); - This->async = hr == S_OK && V_BOOL(&async) == VARIANT_TRUE; + VariantInit(&is_async); + hr = VariantChangeType(&is_async, &async, 0, VT_BOOL); + This->async = hr == S_OK && V_BOOL(&is_async) == VARIANT_TRUE;
VariantInit(&str); hr = VariantChangeType(&str, &user, 0, VT_BSTR);