From 331e179632b0519451d25dc02729a2e9fc2713d6 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 18 Jul 2010 17:18:13 +0400 Subject: [PATCH] msxml3: Speed up a IPersistStreamInit::Save() by querying for BSTR length. --- dlls/msxml3/domdoc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 0007503a2d7..f9f02e029d5 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -415,22 +415,20 @@ static HRESULT WINAPI domdoc_IPersistStreamInit_Load( } static HRESULT WINAPI domdoc_IPersistStreamInit_Save( - IPersistStreamInit *iface, LPSTREAM pStm, BOOL fClearDirty) + IPersistStreamInit *iface, IStream *stream, BOOL clr_dirty) { domdoc *This = impl_from_IPersistStreamInit(iface); - HRESULT hr; BSTR xmlString; + HRESULT hr; - TRACE("(%p)->(%p %d)\n", This, pStm, fClearDirty); + TRACE("(%p)->(%p %d)\n", This, stream, clr_dirty); hr = IXMLDOMNode_get_xml( IXMLDOMNode_from_impl(&This->node), &xmlString ); if(hr == S_OK) { - DWORD count; - DWORD len = strlenW(xmlString) * sizeof(WCHAR); - - hr = IStream_Write( pStm, xmlString, len, &count ); + DWORD len = SysStringLen(xmlString) * sizeof(WCHAR); + hr = IStream_Write( stream, xmlString, len, NULL ); SysFreeString(xmlString); }