Author: cwittich
Date: Sat Aug 22 17:10:54 2009
New Revision: 42846
URL:
http://svn.reactos.org/svn/reactos?rev=42846&view=rev
Log:
sync msxml3 with wine 1.1.28
Modified:
trunk/reactos/dll/win32/msxml3/attribute.c
trunk/reactos/dll/win32/msxml3/cdata.c
trunk/reactos/dll/win32/msxml3/comment.c
trunk/reactos/dll/win32/msxml3/dispex.c
trunk/reactos/dll/win32/msxml3/docfrag.c
trunk/reactos/dll/win32/msxml3/domdoc.c
trunk/reactos/dll/win32/msxml3/element.c
trunk/reactos/dll/win32/msxml3/entityref.c
trunk/reactos/dll/win32/msxml3/main.c
trunk/reactos/dll/win32/msxml3/msxml_private.h
trunk/reactos/dll/win32/msxml3/node.c
trunk/reactos/dll/win32/msxml3/pi.c
trunk/reactos/dll/win32/msxml3/regsvr.c
trunk/reactos/dll/win32/msxml3/text.c
Modified: trunk/reactos/dll/win32/msxml3/attribute.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/attribute…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/attribute.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/attribute.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -547,7 +547,7 @@
IUnknown* create_attribute( xmlNodePtr attribute )
{
domattr *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -556,22 +556,15 @@
This->lpVtbl = &domattr_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( attribute, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( attribute, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/cdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/cdata.c?r…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/cdata.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/cdata.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -770,7 +770,7 @@
IUnknown* create_cdata( xmlNodePtr text )
{
domcdata *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -779,22 +779,15 @@
This->lpVtbl = &domcdata_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( text, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( text, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/comment.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/comment.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/comment.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/comment.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -768,7 +768,7 @@
IUnknown* create_comment( xmlNodePtr comment )
{
domcomment *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -777,22 +777,15 @@
This->lpVtbl = &domcomment_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( comment, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( comment, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/dispex.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/dispex.c?…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/dispex.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/dispex.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -634,6 +634,9 @@
}else if(IsEqualGUID(&IID_UndocumentedScriptIface, riid)) {
TRACE("(%p)->(IID_UndocumentedScriptIface %p) returning NULL\n",
This, ppv);
*ppv = NULL;
+ }else if (IsEqualGUID(&IID_IObjectIdentity, riid)) {
+ TRACE("IID_IObjectIdentity not supported returning NULL\n");
+ *ppv = NULL;
}else {
return FALSE;
}
Modified: trunk/reactos/dll/win32/msxml3/docfrag.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/docfrag.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/docfrag.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/docfrag.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -520,7 +520,7 @@
IUnknown* create_doc_fragment( xmlNodePtr fragment )
{
domfrag *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -529,22 +529,15 @@
This->lpVtbl = &domfrag_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( fragment, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( fragment, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/domdoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/domdoc.c?…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/domdoc.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -64,8 +64,7 @@
VARIANT_BOOL resolving;
VARIANT_BOOL preserving;
BOOL bUseXPath;
- IUnknown *node_unk;
- IXMLDOMNode *node;
+ xmlnode *node;
IXMLDOMSchemaCollection *schema;
bsc_t *bsc;
HRESULT error;
@@ -210,16 +209,14 @@
return S_FALSE;
}
-static HRESULT attach_xmldoc( IXMLDOMNode *node, xmlDocPtr xml )
-{
- xmlnode *This = impl_from_IXMLDOMNode( node );
-
- if(This->node)
- xmldoc_release(This->node->doc);
-
- This->node = (xmlNodePtr) xml;
- if(This->node)
- xmldoc_add_ref(This->node->doc);
+static HRESULT attach_xmldoc( xmlnode *node, xmlDocPtr xml )
+{
+ if(node->node)
+ xmldoc_release(node->node->doc);
+
+ node->node = (xmlNodePtr) xml;
+ if(node->node)
+ xmldoc_add_ref(node->node->doc);
return S_OK;
}
@@ -231,7 +228,7 @@
static inline xmlDocPtr get_doc( domdoc *This )
{
- return (xmlDocPtr) xmlNodePtr_from_domnode( This->node, XML_DOCUMENT_NODE );
+ return (xmlDocPtr)This->node->node;
}
static inline domdoc *impl_from_IPersistStream(IPersistStream *iface)
@@ -363,7 +360,7 @@
TRACE("(%p, %p, %d)\n", iface, pStm, fClearDirty);
- hr = IXMLDOMNode_get_xml( This->node, &xmlString );
+ hr = IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(This->node), &xmlString );
if(hr == S_OK)
{
DWORD count;
@@ -455,7 +452,7 @@
}
else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) )
{
- return IUnknown_QueryInterface(This->node_unk, riid, ppvObject);
+ *ppvObject = IXMLDOMNode_from_impl(This->node);
}
else if (IsEqualGUID(&IID_IPersistStream, riid))
{
@@ -484,7 +481,7 @@
return E_NOINTERFACE;
}
- IXMLDOMDocument_AddRef( iface );
+ IUnknown_AddRef((IUnknown*)*ppvObject);
return S_OK;
}
@@ -515,7 +512,7 @@
if (This->site)
IUnknown_Release( This->site );
- IUnknown_Release( This->node_unk );
+ IXMLDOMNode_Release(IXMLDOMNode_from_impl(This->node));
if(This->schema) IXMLDOMSchemaCollection_Release( This->schema );
if (This->stream) IStream_Release(This->stream);
HeapFree( GetProcessHeap(), 0, This );
@@ -613,7 +610,7 @@
BSTR* name )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_nodeName( This->node, name );
+ return IXMLDOMNode_get_nodeName( IXMLDOMNode_from_impl(This->node), name );
}
@@ -622,7 +619,7 @@
VARIANT* value )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_nodeValue( This->node, value );
+ return IXMLDOMNode_get_nodeValue( IXMLDOMNode_from_impl(This->node), value );
}
@@ -631,7 +628,7 @@
VARIANT value)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_put_nodeValue( This->node, value );
+ return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(This->node), value );
}
@@ -640,7 +637,7 @@
DOMNodeType* type )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_nodeType( This->node, type );
+ return IXMLDOMNode_get_nodeType( IXMLDOMNode_from_impl(This->node), type );
}
@@ -649,7 +646,7 @@
IXMLDOMNode** parent )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_parentNode( This->node, parent );
+ return IXMLDOMNode_get_parentNode( IXMLDOMNode_from_impl(This->node), parent );
}
@@ -658,7 +655,7 @@
IXMLDOMNodeList** childList )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_childNodes( This->node, childList );
+ return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(This->node), childList
);
}
@@ -667,7 +664,7 @@
IXMLDOMNode** firstChild )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_firstChild( This->node, firstChild );
+ return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(This->node), firstChild
);
}
@@ -676,7 +673,7 @@
IXMLDOMNode** lastChild )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_lastChild( This->node, lastChild );
+ return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(This->node), lastChild );
}
@@ -685,7 +682,7 @@
IXMLDOMNode** previousSibling )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_previousSibling( This->node, previousSibling );
+ return IXMLDOMNode_get_previousSibling( IXMLDOMNode_from_impl(This->node),
previousSibling );
}
@@ -694,7 +691,7 @@
IXMLDOMNode** nextSibling )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_nextSibling( This->node, nextSibling );
+ return IXMLDOMNode_get_nextSibling( IXMLDOMNode_from_impl(This->node), nextSibling
);
}
@@ -703,7 +700,7 @@
IXMLDOMNamedNodeMap** attributeMap )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_attributes( This->node, attributeMap );
+ return IXMLDOMNode_get_attributes( IXMLDOMNode_from_impl(This->node), attributeMap
);
}
@@ -714,7 +711,7 @@
IXMLDOMNode** outNewChild )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_insertBefore( This->node, newChild, refChild, outNewChild );
+ return IXMLDOMNode_insertBefore( IXMLDOMNode_from_impl(This->node), newChild,
refChild, outNewChild );
}
@@ -725,7 +722,7 @@
IXMLDOMNode** outOldChild)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_replaceChild( This->node, newChild, oldChild, outOldChild );
+ return IXMLDOMNode_replaceChild( IXMLDOMNode_from_impl(This->node), newChild,
oldChild, outOldChild );
}
@@ -735,7 +732,7 @@
IXMLDOMNode** oldChild)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_removeChild( This->node, childNode, oldChild );
+ return IXMLDOMNode_removeChild( IXMLDOMNode_from_impl(This->node), childNode,
oldChild );
}
@@ -745,7 +742,7 @@
IXMLDOMNode** outNewChild)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_appendChild( This->node, newChild, outNewChild );
+ return IXMLDOMNode_appendChild( IXMLDOMNode_from_impl(This->node), newChild,
outNewChild );
}
@@ -754,7 +751,7 @@
VARIANT_BOOL* hasChild)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_hasChildNodes( This->node, hasChild );
+ return IXMLDOMNode_hasChildNodes( IXMLDOMNode_from_impl(This->node), hasChild );
}
@@ -763,7 +760,7 @@
IXMLDOMDocument** DOMDocument)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_ownerDocument( This->node, DOMDocument );
+ return IXMLDOMNode_get_ownerDocument( IXMLDOMNode_from_impl(This->node),
DOMDocument );
}
@@ -773,7 +770,7 @@
IXMLDOMNode** cloneRoot)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_cloneNode( This->node, deep, cloneRoot );
+ return IXMLDOMNode_cloneNode( IXMLDOMNode_from_impl(This->node), deep, cloneRoot
);
}
@@ -782,7 +779,7 @@
BSTR* nodeType )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_nodeTypeString( This->node, nodeType );
+ return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(This->node), nodeType
);
}
@@ -791,7 +788,7 @@
BSTR* text )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_text( This->node, text );
+ return IXMLDOMNode_get_text( IXMLDOMNode_from_impl(This->node), text );
}
@@ -800,7 +797,7 @@
BSTR text )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_put_text( This->node, text );
+ return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(This->node), text );
}
@@ -809,7 +806,7 @@
VARIANT_BOOL* isSpecified )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_specified( This->node, isSpecified );
+ return IXMLDOMNode_get_specified( IXMLDOMNode_from_impl(This->node), isSpecified
);
}
@@ -818,7 +815,7 @@
IXMLDOMNode** definitionNode )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_definition( This->node, definitionNode );
+ return IXMLDOMNode_get_definition( IXMLDOMNode_from_impl(This->node),
definitionNode );
}
@@ -827,7 +824,7 @@
VARIANT* typedValue )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_nodeTypedValue( This->node, typedValue );
+ return IXMLDOMNode_get_nodeTypedValue( IXMLDOMNode_from_impl(This->node),
typedValue );
}
static HRESULT WINAPI domdoc_put_nodeTypedValue(
@@ -835,7 +832,7 @@
VARIANT typedValue )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_put_nodeTypedValue( This->node, typedValue );
+ return IXMLDOMNode_put_nodeTypedValue( IXMLDOMNode_from_impl(This->node),
typedValue );
}
@@ -844,7 +841,7 @@
VARIANT* dataTypeName )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_dataType( This->node, dataTypeName );
+ return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(This->node), dataTypeName
);
}
@@ -853,7 +850,7 @@
BSTR dataTypeName )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_put_dataType( This->node, dataTypeName );
+ return IXMLDOMNode_put_dataType( IXMLDOMNode_from_impl(This->node), dataTypeName
);
}
@@ -862,7 +859,7 @@
BSTR* xmlString )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_xml( This->node, xmlString );
+ return IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(This->node), xmlString );
}
@@ -872,7 +869,7 @@
BSTR* xmlString )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_transformNode( This->node, styleSheet, xmlString );
+ return IXMLDOMNode_transformNode( IXMLDOMNode_from_impl(This->node), styleSheet,
xmlString );
}
@@ -882,7 +879,7 @@
IXMLDOMNodeList** resultList )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_selectNodes( This->node, queryString, resultList );
+ return IXMLDOMNode_selectNodes( IXMLDOMNode_from_impl(This->node), queryString,
resultList );
}
@@ -892,7 +889,7 @@
IXMLDOMNode** resultNode )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_selectSingleNode( This->node, queryString, resultNode );
+ return IXMLDOMNode_selectSingleNode( IXMLDOMNode_from_impl(This->node),
queryString, resultNode );
}
@@ -901,7 +898,7 @@
VARIANT_BOOL* isParsed )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_parsed( This->node, isParsed );
+ return IXMLDOMNode_get_parsed( IXMLDOMNode_from_impl(This->node), isParsed );
}
@@ -910,7 +907,7 @@
BSTR* namespaceURI )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_namespaceURI( This->node, namespaceURI );
+ return IXMLDOMNode_get_namespaceURI( IXMLDOMNode_from_impl(This->node),
namespaceURI );
}
@@ -919,7 +916,7 @@
BSTR* prefixString )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_prefix( This->node, prefixString );
+ return IXMLDOMNode_get_prefix( IXMLDOMNode_from_impl(This->node), prefixString );
}
@@ -928,7 +925,7 @@
BSTR* nameString )
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_get_baseName( This->node, nameString );
+ return IXMLDOMNode_get_baseName( IXMLDOMNode_from_impl(This->node), nameString );
}
@@ -938,7 +935,7 @@
VARIANT outputObject)
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
- return IXMLDOMNode_transformNodeToObject( This->node, stylesheet, outputObject );
+ return IXMLDOMNode_transformNodeToObject( IXMLDOMNode_from_impl(This->node),
stylesheet, outputObject );
}
@@ -2198,7 +2195,6 @@
HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument2 **document)
{
domdoc *doc;
- HRESULT hr;
doc = HeapAlloc( GetProcessHeap(), 0, sizeof (*doc) );
if( !doc )
@@ -2222,25 +2218,14 @@
doc->safeopt = 0;
doc->bsc = NULL;
- doc->node_unk = create_basic_node( (xmlNodePtr)xmldoc,
(IUnknown*)&doc->lpVtbl );
- if(!doc->node_unk)
+ doc->node = create_basic_node( (xmlNodePtr)xmldoc, (IUnknown*)&doc->lpVtbl
);
+ if(!doc->node)
{
HeapFree(GetProcessHeap(), 0, doc);
return E_FAIL;
}
- hr = IUnknown_QueryInterface(doc->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&doc->node);
- if(FAILED(hr))
- {
- IUnknown_Release(doc->node_unk);
- HeapFree( GetProcessHeap(), 0, doc );
- return E_FAIL;
- }
-
init_dispex(&doc->dispex, (IUnknown*)&doc->lpVtbl,
&domdoc_dispex);
-
- /* The ref on doc->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(doc->node);
*document = (IXMLDOMDocument2*)&doc->lpVtbl;
Modified: trunk/reactos/dll/win32/msxml3/element.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/element.c…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/element.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -44,8 +44,7 @@
const struct IUnknownVtbl *lpInternalUnkVtbl;
IUnknown *pUnkOuter;
LONG ref;
- IUnknown *node_unk;
- IXMLDOMNode *node;
+ xmlnode *node;
} domelem;
static inline domelem *impl_from_IXMLDOMElement( IXMLDOMElement *iface )
@@ -60,7 +59,7 @@
static inline xmlNodePtr get_element( domelem *This )
{
- return xmlNodePtr_from_domnode( This->node, XML_ELEMENT_NODE );
+ return This->node->node;
}
static HRESULT WINAPI domelem_QueryInterface(
@@ -170,7 +169,7 @@
BSTR* p )
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_nodeName( This->node, p );
+ return IXMLDOMNode_get_nodeName( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_get_nodeValue(
@@ -178,7 +177,7 @@
VARIANT* var1 )
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_nodeValue( This->node, var1 );
+ return IXMLDOMNode_get_nodeValue( IXMLDOMNode_from_impl(This->node), var1 );
}
static HRESULT WINAPI domelem_put_nodeValue(
@@ -186,7 +185,7 @@
VARIANT var1 )
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_put_nodeValue( This->node, var1 );
+ return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(This->node), var1 );
}
static HRESULT WINAPI domelem_get_nodeType(
@@ -194,7 +193,7 @@
DOMNodeType* domNodeType )
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_nodeType( This->node, domNodeType );
+ return IXMLDOMNode_get_nodeType( IXMLDOMNode_from_impl(This->node), domNodeType
);
}
static HRESULT WINAPI domelem_get_parentNode(
@@ -202,7 +201,7 @@
IXMLDOMNode** parent )
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_parentNode( This->node, parent );
+ return IXMLDOMNode_get_parentNode( IXMLDOMNode_from_impl(This->node), parent );
}
static HRESULT WINAPI domelem_get_childNodes(
@@ -210,7 +209,7 @@
IXMLDOMNodeList** outList)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_childNodes( This->node, outList );
+ return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(This->node), outList );
}
static HRESULT WINAPI domelem_get_firstChild(
@@ -218,7 +217,7 @@
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_firstChild( This->node, domNode );
+ return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(This->node), domNode );
}
static HRESULT WINAPI domelem_get_lastChild(
@@ -226,7 +225,7 @@
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_lastChild( This->node, domNode );
+ return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(This->node), domNode );
}
static HRESULT WINAPI domelem_get_previousSibling(
@@ -234,7 +233,7 @@
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_previousSibling( This->node, domNode );
+ return IXMLDOMNode_get_previousSibling( IXMLDOMNode_from_impl(This->node), domNode
);
}
static HRESULT WINAPI domelem_get_nextSibling(
@@ -242,7 +241,7 @@
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_nextSibling( This->node, domNode );
+ return IXMLDOMNode_get_nextSibling( IXMLDOMNode_from_impl(This->node), domNode );
}
static HRESULT WINAPI domelem_get_attributes(
@@ -250,7 +249,7 @@
IXMLDOMNamedNodeMap** attributeMap)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_attributes( This->node, attributeMap );
+ return IXMLDOMNode_get_attributes( IXMLDOMNode_from_impl(This->node), attributeMap
);
}
static HRESULT WINAPI domelem_insertBefore(
@@ -259,7 +258,7 @@
IXMLDOMNode** outOldNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_insertBefore( This->node, newNode, var1, outOldNode );
+ return IXMLDOMNode_insertBefore( IXMLDOMNode_from_impl(This->node), newNode, var1,
outOldNode );
}
static HRESULT WINAPI domelem_replaceChild(
@@ -269,7 +268,7 @@
IXMLDOMNode** outOldNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_replaceChild( This->node, newNode, oldNode, outOldNode );
+ return IXMLDOMNode_replaceChild( IXMLDOMNode_from_impl(This->node), newNode,
oldNode, outOldNode );
}
static HRESULT WINAPI domelem_removeChild(
@@ -277,7 +276,7 @@
IXMLDOMNode* domNode, IXMLDOMNode** oldNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_removeChild( This->node, domNode, oldNode );
+ return IXMLDOMNode_removeChild( IXMLDOMNode_from_impl(This->node), domNode,
oldNode );
}
static HRESULT WINAPI domelem_appendChild(
@@ -285,7 +284,7 @@
IXMLDOMNode* newNode, IXMLDOMNode** outNewNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_appendChild( This->node, newNode, outNewNode );
+ return IXMLDOMNode_appendChild( IXMLDOMNode_from_impl(This->node), newNode,
outNewNode );
}
static HRESULT WINAPI domelem_hasChildNodes(
@@ -293,7 +292,7 @@
VARIANT_BOOL* pbool)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_hasChildNodes( This->node, pbool );
+ return IXMLDOMNode_hasChildNodes( IXMLDOMNode_from_impl(This->node), pbool );
}
static HRESULT WINAPI domelem_get_ownerDocument(
@@ -301,7 +300,7 @@
IXMLDOMDocument** domDocument)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_ownerDocument( This->node, domDocument );
+ return IXMLDOMNode_get_ownerDocument( IXMLDOMNode_from_impl(This->node),
domDocument );
}
static HRESULT WINAPI domelem_cloneNode(
@@ -309,7 +308,7 @@
VARIANT_BOOL pbool, IXMLDOMNode** outNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_cloneNode( This->node, pbool, outNode );
+ return IXMLDOMNode_cloneNode( IXMLDOMNode_from_impl(This->node), pbool, outNode
);
}
static HRESULT WINAPI domelem_get_nodeTypeString(
@@ -317,7 +316,7 @@
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_nodeTypeString( This->node, p );
+ return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_get_text(
@@ -325,7 +324,7 @@
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_text( This->node, p );
+ return IXMLDOMNode_get_text( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_put_text(
@@ -333,7 +332,7 @@
BSTR p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_put_text( This->node, p );
+ return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_get_specified(
@@ -341,7 +340,7 @@
VARIANT_BOOL* pbool)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_specified( This->node, pbool );
+ return IXMLDOMNode_get_specified( IXMLDOMNode_from_impl(This->node), pbool );
}
static HRESULT WINAPI domelem_get_definition(
@@ -349,7 +348,7 @@
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_definition( This->node, domNode );
+ return IXMLDOMNode_get_definition( IXMLDOMNode_from_impl(This->node), domNode );
}
static HRESULT WINAPI domelem_get_nodeTypedValue(
@@ -357,7 +356,7 @@
VARIANT* var1)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_nodeTypedValue( This->node, var1 );
+ return IXMLDOMNode_get_nodeTypedValue( IXMLDOMNode_from_impl(This->node), var1 );
}
static HRESULT WINAPI domelem_put_nodeTypedValue(
@@ -365,7 +364,7 @@
VARIANT var1)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_put_nodeTypedValue( This->node, var1 );
+ return IXMLDOMNode_put_nodeTypedValue( IXMLDOMNode_from_impl(This->node), var1 );
}
static HRESULT WINAPI domelem_get_dataType(
@@ -373,7 +372,7 @@
VARIANT* var1)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_dataType( This->node, var1 );
+ return IXMLDOMNode_get_dataType( IXMLDOMNode_from_impl(This->node), var1 );
}
static HRESULT WINAPI domelem_put_dataType(
@@ -381,7 +380,7 @@
BSTR p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_put_dataType( This->node, p );
+ return IXMLDOMNode_put_dataType( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_get_xml(
@@ -389,7 +388,7 @@
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_xml( This->node, p );
+ return IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_transformNode(
@@ -397,7 +396,7 @@
IXMLDOMNode* domNode, BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_transformNode( This->node, domNode, p );
+ return IXMLDOMNode_transformNode( IXMLDOMNode_from_impl(This->node), domNode, p
);
}
static HRESULT WINAPI domelem_selectNodes(
@@ -405,7 +404,7 @@
BSTR p, IXMLDOMNodeList** outList)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_selectNodes( This->node, p, outList );
+ return IXMLDOMNode_selectNodes( IXMLDOMNode_from_impl(This->node), p, outList );
}
static HRESULT WINAPI domelem_selectSingleNode(
@@ -413,7 +412,7 @@
BSTR p, IXMLDOMNode** outNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_selectSingleNode( This->node, p, outNode );
+ return IXMLDOMNode_selectSingleNode( IXMLDOMNode_from_impl(This->node), p, outNode
);
}
static HRESULT WINAPI domelem_get_parsed(
@@ -421,7 +420,7 @@
VARIANT_BOOL* pbool)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_parsed( This->node, pbool );
+ return IXMLDOMNode_get_parsed( IXMLDOMNode_from_impl(This->node), pbool );
}
static HRESULT WINAPI domelem_get_namespaceURI(
@@ -429,7 +428,7 @@
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_namespaceURI( This->node, p );
+ return IXMLDOMNode_get_namespaceURI( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_get_prefix(
@@ -437,7 +436,7 @@
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_prefix( This->node, p );
+ return IXMLDOMNode_get_prefix( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_get_baseName(
@@ -445,7 +444,7 @@
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_get_baseName( This->node, p );
+ return IXMLDOMNode_get_baseName( IXMLDOMNode_from_impl(This->node), p );
}
static HRESULT WINAPI domelem_transformNodeToObject(
@@ -453,7 +452,7 @@
IXMLDOMNode* domNode, VARIANT var1)
{
domelem *This = impl_from_IXMLDOMElement( iface );
- return IXMLDOMNode_transformNodeToObject( This->node, domNode, var1 );
+ return IXMLDOMNode_transformNodeToObject( IXMLDOMNode_from_impl(This->node),
domNode, var1 );
}
static HRESULT WINAPI domelem_get_tagName(
@@ -744,7 +743,7 @@
}
else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) )
{
- return IUnknown_QueryInterface(This->node_unk, riid, ppvObject);
+ *ppvObject = IXMLDOMNode_from_impl(This->node);
}
else
{
@@ -773,7 +772,7 @@
ref = InterlockedDecrement( &This->ref );
if ( ref == 0 )
{
- IUnknown_Release( This->node_unk );
+ IXMLDOMNode_Release( IXMLDOMNode_from_impl(This->node) );
HeapFree( GetProcessHeap(), 0, This );
}
@@ -790,7 +789,6 @@
IUnknown* create_element( xmlNodePtr element, IUnknown *pUnkOuter )
{
domelem *This;
- HRESULT hr;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -805,23 +803,13 @@
else
This->pUnkOuter = (IUnknown *)&This->lpInternalUnkVtbl;
- This->node_unk = create_basic_node( element, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ This->node = create_basic_node( element, (IUnknown*)&This->lpVtbl );
+ if(!This->node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
-
return (IUnknown*) &This->lpInternalUnkVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/entityref.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/entityref…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/entityref.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/entityref.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -519,7 +519,7 @@
IUnknown* create_doc_entity_ref( xmlNodePtr entity )
{
entityref *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -528,22 +528,15 @@
This->lpVtbl = &entityref_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( entity, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( entity, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/main.c?re…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/main.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -32,12 +32,75 @@
#include "msxml.h"
#include "msxml2.h"
+#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/library.h"
#include "msxml_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
+
+#ifdef HAVE_LIBXML2
+
+/* Support for loading xml files from a Wine Windows drive */
+static int wineXmlMatchCallback (char const * filename)
+{
+ int nRet = 0;
+
+ TRACE("%s\n", filename);
+
+ /*
+ * We will deal with loading XML files from the file system
+ * We only care about files that linux cannot find.
+ * e.g. C:,D: etc
+ */
+ if(isalpha(filename[0]) && filename[1] == ':')
+ nRet = 1;
+
+ return nRet;
+}
+
+static void *wineXmlOpenCallback (char const * filename)
+{
+ BSTR sFilename = bstr_from_xmlChar( (xmlChar*)filename);
+ HANDLE hFile;
+
+ TRACE("%s\n", debugstr_w(sFilename));
+
+ hFile = CreateFileW(sFilename, GENERIC_READ,FILE_SHARE_READ, NULL,
+ OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, NULL);
+ if(hFile == INVALID_HANDLE_VALUE) hFile = 0;
+ SysFreeString(sFilename);
+ return hFile;
+}
+
+static int wineXmlReadCallback(void * context, char * buffer, int len)
+{
+ DWORD dwBytesRead;
+
+ TRACE("%p %s %d\n", context, buffer, len);
+
+ if ((context == NULL) || (buffer == NULL))
+ return(-1);
+
+ if(!ReadFile( context, buffer,len, &dwBytesRead, NULL))
+ {
+ ERR("Failed to read file\n");
+ return -1;
+ }
+
+ TRACE("Read %d\n", dwBytesRead);
+
+ return dwBytesRead;
+}
+
+static int wineXmlFileCloseCallback (void * context)
+{
+ return CloseHandle(context) ? 0 : -1;
+}
+
+#endif
+
HRESULT WINAPI DllCanUnloadNow(void)
{
@@ -96,6 +159,12 @@
for this thread and as default for new threads */
xmlTreeIndentString = "\t";
xmlThrDefTreeIndentString("\t");
+
+ /* Register callbacks for loading XML files */
+ if(xmlRegisterInputCallbacks(wineXmlMatchCallback, wineXmlOpenCallback,
+ wineXmlReadCallback, wineXmlFileCloseCallback) == -1)
+ WARN("Failed to register callbacks\n");
+
#endif
init_libxslt();
DisableThreadLibraryCalls(hInstDLL);
@@ -110,6 +179,10 @@
}
#endif
#ifdef HAVE_LIBXML2
+ /* Restore default Callbacks */
+ xmlCleanupInputCallbacks();
+ xmlRegisterDefaultInputCallbacks();
+
xmlCleanupParser();
#endif
release_typelib();
Modified: trunk/reactos/dll/win32/msxml3/msxml_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/msxml_pri…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/msxml_private.h [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -39,7 +39,6 @@
extern IUnknown *create_domdoc( xmlNodePtr document );
extern IUnknown *create_xmldoc( void );
extern IXMLDOMNode *create_node( xmlNodePtr node );
-extern IUnknown *create_basic_node( xmlNodePtr node, IUnknown *pUnkOuter );
extern IUnknown *create_element( xmlNodePtr element, IUnknown *pUnkOuter );
extern IUnknown *create_attribute( xmlNodePtr attribute );
extern IUnknown *create_text( xmlNodePtr text );
@@ -59,7 +58,6 @@
/* helpers */
extern xmlChar *xmlChar_from_wchar( LPWSTR str );
-extern BSTR bstr_from_xmlChar( const xmlChar *buf );
extern LONG xmldoc_add_ref( xmlDocPtr doc );
extern LONG xmldoc_release( xmlDocPtr doc );
@@ -85,7 +83,28 @@
return (xmlnode *)((char*)iface - FIELD_OFFSET(xmlnode, lpVtbl));
}
+static inline IXMLDOMNode *IXMLDOMNode_from_impl(xmlnode *This)
+{
+ return (IXMLDOMNode*)&This->lpVtbl;
+}
+
+extern xmlnode *create_basic_node(xmlNodePtr,IUnknown*);
+
extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument2
**document);
+
+static inline BSTR bstr_from_xmlChar(const xmlChar *str)
+{
+ BSTR ret = NULL;
+
+ if(str) {
+ DWORD len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)str, -1, NULL, 0);
+ ret = SysAllocStringLen(NULL, len-1);
+ if(ret)
+ MultiByteToWideChar( CP_UTF8, 0, (LPCSTR)str, -1, ret, len);
+ }
+
+ return ret;
+}
#endif
Modified: trunk/reactos/dll/win32/msxml3/node.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/node.c?re…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/node.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -245,25 +245,6 @@
return S_FALSE;
return S_OK;
-}
-
-BSTR bstr_from_xmlChar( const xmlChar *buf )
-{
- DWORD len;
- LPWSTR str;
- BSTR bstr;
-
- if ( !buf )
- return NULL;
-
- len = MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) buf, -1, NULL, 0 );
- str = HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) );
- if ( !str )
- return NULL;
- MultiByteToWideChar( CP_UTF8, 0, (LPCSTR) buf, -1, str, len );
- bstr = SysAllocString( str );
- HeapFree( GetProcessHeap(), 0, str );
- return bstr;
}
static HRESULT WINAPI xmlnode_get_nodeValue(
@@ -1561,7 +1542,7 @@
Internal_Release
};
-IUnknown *create_basic_node( xmlNodePtr node, IUnknown *pUnkOuter )
+xmlnode *create_basic_node( xmlNodePtr node, IUnknown *pUnkOuter )
{
xmlnode *This;
@@ -1583,7 +1564,7 @@
This->ref = 1;
This->node = node;
- return (IUnknown*)&This->lpInternalUnkVtbl;
+ return This;
}
IXMLDOMNode *create_node( xmlNodePtr node )
@@ -1618,7 +1599,7 @@
break;
default:
FIXME("only creating basic node for type %d\n", node->type);
- pUnk = create_basic_node( node, NULL );
+ pUnk = (IUnknown*)&create_basic_node( node, NULL )->lpInternalUnkVtbl;
}
hr = IUnknown_QueryInterface(pUnk, &IID_IXMLDOMNode, (LPVOID*)&ret);
Modified: trunk/reactos/dll/win32/msxml3/pi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/pi.c?rev=…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/pi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/pi.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -605,7 +605,7 @@
IUnknown* create_pi( xmlNodePtr pi )
{
dom_pi *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -614,22 +614,15 @@
This->lpVtbl = &dom_pi_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( pi, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( pi, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}
Modified: trunk/reactos/dll/win32/msxml3/regsvr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/regsvr.c?…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/regsvr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/regsvr.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -572,6 +572,22 @@
"Msxml2.SAXXMLReader",
"3.0"
},
+ { &CLSID_MXXMLWriter,
+ "IMXWriter interface",
+ NULL,
+ "msxml3.dll",
+ "Both",
+ "Msxml2.MXXMLWriter",
+ "3.0"
+ },
+ { &CLSID_MXXMLWriter30,
+ "IMXWriter interface 3.0",
+ NULL,
+ "msxml3.dll",
+ "Both",
+ "Msxml2.MXXMLWriter",
+ "3.0"
+ },
{ NULL } /* list terminator */
};
@@ -669,6 +685,16 @@
{ "Msxml2.SAXXMLReader.3.0",
"SAX XML Reader 3.0",
&CLSID_SAXXMLReader30,
+ NULL
+ },
+ { "Msxml2.MXXMLWriter",
+ "MXXMLWriter",
+ &CLSID_MXXMLWriter,
+ "Msxml2.MXXMLWriter.3.0"
+ },
+ { "Msxml2.MXXMLWriter.3.0",
+ "MXXMLWriter 3.0",
+ &CLSID_MXXMLWriter30,
NULL
},
Modified: trunk/reactos/dll/win32/msxml3/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msxml3/text.c?re…
==============================================================================
--- trunk/reactos/dll/win32/msxml3/text.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msxml3/text.c [iso-8859-1] Sat Aug 22 17:10:54 2009
@@ -772,7 +772,7 @@
IUnknown* create_text( xmlNodePtr text )
{
domtext *This;
- HRESULT hr;
+ xmlnode *node;
This = HeapAlloc( GetProcessHeap(), 0, sizeof *This );
if ( !This )
@@ -781,22 +781,15 @@
This->lpVtbl = &domtext_vtbl;
This->ref = 1;
- This->node_unk = create_basic_node( text, (IUnknown*)&This->lpVtbl );
- if(!This->node_unk)
+ node = create_basic_node( text, (IUnknown*)&This->lpVtbl );
+ if(!node)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
- hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode,
(LPVOID*)&This->node);
- if(FAILED(hr))
- {
- IUnknown_Release(This->node_unk);
- HeapFree( GetProcessHeap(), 0, This );
- return NULL;
- }
- /* The ref on This->node is actually looped back into this object, so release it
*/
- IXMLDOMNode_Release(This->node);
+ This->node_unk = (IUnknown*)&node->lpInternalUnkVtbl;
+ This->node = IXMLDOMNode_from_impl(node);
return (IUnknown*) &This->lpVtbl;
}