msxml3: Speed up a IPersistStreamInit::Save() by querying for BSTR length.

This commit is contained in:
Nikolay Sivov 2010-07-18 17:18:13 +04:00 committed by Alexandre Julliard
parent 94666ebf0d
commit 331e179632

View File

@ -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);
}