Function write, need add other func.

Josef Reidinger josef.reidinger at seznam.cz
Fri Jan 11 18:53:03 CST 2008


---
 dlls/msxml3/domdoc.c |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 8477d88..88aa511 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -181,8 +181,10 @@ typedef struct _domdoc
     IXMLDOMSchemaCollection *schema;
     HRESULT error;
 
-     /* IPersistStream and also IStream*/
+     /* IPersistStream */
      IStream *stream;
+		 /* for istrem chunk */
+		 xmlParserCtxtPtr	chunkParser;
 } domdoc;
 
 LONG xmldoc_add_ref(xmlDocPtr doc)
@@ -374,17 +376,31 @@ static HRESULT WINAPI xmldoc_IStream_Read(
     IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
 {
 		domdoc *This = impl_from_IStream(iface);
-		if (!This->Stream){
-			
-		}
-		return IStream_Read(This->stream,pv,cb,pcbRead);
+    FIXME("(%p, %p, %lu, %p): stub!\n", iface, pv, cb, pcbRead);
+		return E_NOTIMPL;
 }
 
 static HRESULT WINAPI xmldoc_IStream_Write(
     IStream *iface, void const *pv, ULONG cb, ULONG *pcbRead)
 {
+		TRACE("\n");
 		domdoc *This = impl_from_IStream(iface);
-		return IStream_Write(This->stream,pv,cb,pcbRead);
+    if (!This->chunkParser){
+		TRACE("1");
+			This->chunkParser = xmlCreatePushParserCtxt	(NULL, NULL,pv, cb, NULL);
+		} else {
+		TRACE("2");
+		  int res = xmlParseChunk	(This->chunkParser, pv,cb, 0);
+		  if (res)
+  			ERR("Parse chunk failed (%p,%p,%lu,%p)",This->chunkParser,pv,cb,pcbRead);
+	  	if (This->chunkParser->wellFormed){
+		  	xmlDocPtr xmldoc = This->chunkParser->myDoc;
+  			attach_xmlnode(This->node, (xmlNodePtr) xmldoc);
+	  		xmlClearParserCtxt(This->chunkParser);
+		  	This->chunkParser = NULL;
+		  }
+		}
+		return S_OK;
 }
 
 
@@ -1896,6 +1912,7 @@ HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
 
     doc->lpVtbl = &domdoc_vtbl;
     doc->lpvtblIPersistStream = &xmldoc_IPersistStream_VTable;
+		doc->lpvtblIStream = &xmldoc_IStream_VTable;
     doc->ref = 1;
     doc->async = 0;
     doc->validating = 0;
@@ -1905,6 +1922,7 @@ HRESULT DOMDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj)
     doc->error = S_OK;
     doc->schema = NULL;
     doc->stream = NULL;
+		doc->chunkParser = NULL;
 
     xmldoc = xmlNewDoc(NULL);
     if(!xmldoc)
-- 
1.5.3.7


--------------040106040909070706090504
Content-Type: text/x-patch;
 name="0003-add-other-interfaces.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="0003-add-other-interfaces.patch"



More information about the wine-patches mailing list