[PATCH] Implement IXMLDOMDocument2 IPersistStream_Save

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Jan 22 03:21:45 CST 2009


---
 dlls/msxml3/domdoc.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 11136ab..20ce5c9 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -357,8 +357,26 @@ static HRESULT WINAPI xmldoc_IPersistStream_Load(
 static HRESULT WINAPI xmldoc_IPersistStream_Save(
     IPersistStream *iface, LPSTREAM pStm, BOOL fClearDirty)
 {
-    FIXME("(%p, %p, %d): stub!\n", iface, pStm, fClearDirty);
-    return E_NOTIMPL;
+    domdoc *This = impl_from_IPersistStream(iface);
+    HRESULT hr;
+    BSTR xmlString;
+
+    TRACE("(%p, %p, %d)\n", iface, pStm, fClearDirty);
+
+    hr = IXMLDOMNode_get_xml( This->node, &xmlString );
+    if(hr == S_OK)
+    {
+        DWORD count;
+        DWORD len = strlenW(xmlString) * sizeof(WCHAR);
+
+        hr = IStream_Write( pStm, xmlString, len, &count );
+
+        SysFreeString(xmlString);
+    }
+
+    TRACE("ret 0x%08x\n", hr);
+
+    return hr;
 }
 
 static HRESULT WINAPI xmldoc_IPersistStream_GetSizeMax(
-- 
1.5.4.3


--------------080100070806060703070107--



More information about the wine-patches mailing list