diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 15c84a6f8ff..1a56a3513c2 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -422,10 +422,11 @@ static HRESULT WINAPI domattr_put_nodeTypedValue( static HRESULT WINAPI domattr_get_dataType( IXMLDOMAttribute *iface, - VARIANT* var1) + VARIANT* typename) { domattr *This = impl_from_IXMLDOMAttribute( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI domattr_put_dataType( diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index b87bbe1571d..bbe8a87f3c7 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -433,10 +433,11 @@ static HRESULT WINAPI domcdata_put_nodeTypedValue( static HRESULT WINAPI domcdata_get_dataType( IXMLDOMCDATASection *iface, - VARIANT* var1) + VARIANT* typename) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI domcdata_put_dataType( diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index 0f2b61a67df..86d4bca0a48 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -426,10 +426,11 @@ static HRESULT WINAPI domcomment_put_nodeTypedValue( static HRESULT WINAPI domcomment_get_dataType( IXMLDOMComment *iface, - VARIANT* var1) + VARIANT* typename) { domcomment *This = impl_from_IXMLDOMComment( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI domcomment_put_dataType( diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c index 99f8e81dcad..d7004933001 100644 --- a/dlls/msxml3/docfrag.c +++ b/dlls/msxml3/docfrag.c @@ -430,10 +430,11 @@ static HRESULT WINAPI domfrag_put_nodeTypedValue( static HRESULT WINAPI domfrag_get_dataType( IXMLDOMDocumentFragment *iface, - VARIANT* var1) + VARIANT* typename) { domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI domfrag_put_dataType( diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 1adc84d738a..9f3f1eb4838 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -1154,10 +1154,11 @@ static HRESULT WINAPI domdoc_put_nodeTypedValue( static HRESULT WINAPI domdoc_get_dataType( IXMLDOMDocument3 *iface, - VARIANT* dataTypeName ) + VARIANT* typename ) { domdoc *This = impl_from_IXMLDOMDocument3( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), dataTypeName ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 16651e844f3..7f3d7ef3827 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -438,10 +438,24 @@ static HRESULT WINAPI domelem_put_nodeTypedValue( static HRESULT WINAPI domelem_get_dataType( IXMLDOMElement *iface, - VARIANT* var1) + VARIANT* typename) { domelem *This = impl_from_IXMLDOMElement( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + xmlChar *pVal = xmlGetNsProp(get_element(This), (const xmlChar*)"dt", + (const xmlChar*)"urn:schemas-microsoft-com:datatypes"); + + TRACE("(%p)->(%p)\n", This, typename); + + V_VT(typename) = VT_NULL; + + if (pVal) + { + V_VT(typename) = VT_BSTR; + V_BSTR(typename) = bstr_from_xmlChar( pVal ); + xmlFree(pVal); + } + + return (V_VT(typename) != VT_NULL) ? S_OK : S_FALSE; } static HRESULT WINAPI domelem_put_dataType( diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c index cc2aa1d0035..f4c31c933fe 100644 --- a/dlls/msxml3/entityref.c +++ b/dlls/msxml3/entityref.c @@ -424,10 +424,11 @@ static HRESULT WINAPI entityref_put_nodeTypedValue( static HRESULT WINAPI entityref_get_dataType( IXMLDOMEntityReference *iface, - VARIANT* var1) + VARIANT* typename) { entityref *This = impl_from_IXMLDOMEntityReference( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + FIXME("(%p)->(%p): should return a valid value\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI entityref_put_dataType( diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index b16267cfbcd..5d0ac7ac5e2 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -172,7 +172,6 @@ extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**); extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**); extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**); - extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document); static inline BSTR bstr_from_xmlChar(const xmlChar *str) @@ -223,6 +222,15 @@ static inline HRESULT return_null_ptr(void **p) return S_FALSE; } +static inline HRESULT return_null_var(VARIANT *p) +{ + if(!p) + return E_INVALIDARG; + + V_VT(p) = VT_NULL; + return S_FALSE; +} + #endif extern void* libxslt_handle; diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 8a92fe6af4e..6716c5d907a 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -1020,45 +1020,8 @@ static HRESULT WINAPI xmlnode_get_dataType( IXMLDOMNode *iface, VARIANT* dataTypeName) { - xmlnode *This = impl_from_IXMLDOMNode( iface ); - xmlChar *pVal; - - TRACE("(%p)->(%p)\n", This, dataTypeName); - - if(!dataTypeName) - return E_INVALIDARG; - - /* Attribute, CDATA Section, Comment, Document, Document Fragment, - Entity, Notation, PI, and Text Node are non-typed. */ - V_BSTR(dataTypeName) = NULL; - V_VT(dataTypeName) = VT_NULL; - - switch ( This->node->type ) - { - case XML_ELEMENT_NODE: - pVal = xmlGetNsProp(This->node, (const xmlChar*)"dt", - (const xmlChar*)"urn:schemas-microsoft-com:datatypes"); - if (pVal) - { - V_VT(dataTypeName) = VT_BSTR; - V_BSTR(dataTypeName) = bstr_from_xmlChar( pVal ); - xmlFree(pVal); - } - break; - case XML_ENTITY_REF_NODE: - FIXME("XML_ENTITY_REF_NODE should return a valid value.\n"); - break; - default: - TRACE("Type %d returning NULL\n", This->node->type); - } - - /* non-typed nodes return S_FALSE */ - if(V_VT(dataTypeName) == VT_NULL) - { - return S_FALSE; - } - - return S_OK; + ERR("Should not be called\n"); + return E_NOTIMPL; } static HRESULT WINAPI xmlnode_put_dataType( diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index 2d33d8034dc..2467603b51e 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -440,10 +440,11 @@ static HRESULT WINAPI dom_pi_put_nodeTypedValue( static HRESULT WINAPI dom_pi_get_dataType( IXMLDOMProcessingInstruction *iface, - VARIANT* var1) + VARIANT* typename) { dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI dom_pi_put_dataType( diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index be61376078f..2e79cd9d4a8 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -439,10 +439,11 @@ static HRESULT WINAPI domtext_put_nodeTypedValue( static HRESULT WINAPI domtext_get_dataType( IXMLDOMText *iface, - VARIANT* var1) + VARIANT* typename) { domtext *This = impl_from_IXMLDOMText( iface ); - return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(&This->node), var1 ); + TRACE("(%p)->(%p)\n", This, typename); + return return_null_var( typename ); } static HRESULT WINAPI domtext_put_dataType(