msxml3: Don't QI for IPersistStream in internal_parse.

Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Daniel Lehman 2017-03-15 09:38:30 -07:00 committed by Alexandre Julliard
parent 05ed831894
commit 8bc68f3491
2 changed files with 6 additions and 28 deletions

View File

@ -2661,7 +2661,6 @@ static HRESULT internal_parse(
}
case VT_UNKNOWN:
case VT_DISPATCH: {
IPersistStream *persistStream;
ISequentialStream *stream = NULL;
IXMLDOMDocument *xmlDoc;
@ -2678,34 +2677,11 @@ static HRESULT internal_parse(
break;
}
if(IUnknown_QueryInterface(V_UNKNOWN(&varInput),
&IID_IPersistStream, (void**)&persistStream) == S_OK)
{
IStream *stream_copy;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream_copy);
if(hr != S_OK)
{
IPersistStream_Release(persistStream);
return hr;
}
hr = IPersistStream_Save(persistStream, stream_copy, TRUE);
IPersistStream_Release(persistStream);
if(hr == S_OK)
IStream_QueryInterface(stream_copy, &IID_ISequentialStream, (void**)&stream);
IStream_Release(stream_copy);
}
/* try base interface first */
if(!stream)
{
IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_ISequentialStream, (void**)&stream);
if (!stream)
/* this should never happen if IStream is implemented properly, but just in case */
IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_IStream, (void**)&stream);
}
IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_ISequentialStream, (void**)&stream);
if (!stream)
/* this should never happen if IStream is implemented properly, but just in case */
IUnknown_QueryInterface(V_UNKNOWN(&varInput), &IID_IStream, (void**)&stream);
if(stream)
{

View File

@ -1908,6 +1908,8 @@ static HRESULT WINAPI istream_QueryInterface(IStream *iface, REFIID riid, void *
{
*ppvObject = NULL;
ok(!IsEqualGUID(riid, &IID_IPersistStream), "Did not expect QI for IPersistStream\n");
if(IsEqualGUID(riid, &IID_IStream) || IsEqualGUID(riid, &IID_IUnknown))
*ppvObject = iface;
else