msxml3: Set internal error on loading from IPersistStream.

Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Daniel Lehman 2020-06-23 21:28:18 -07:00 committed by Alexandre Julliard
parent 50650c26fe
commit da3893fe48
2 changed files with 17 additions and 1 deletions

View file

@ -824,7 +824,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream
if (!stream)
return E_INVALIDARG;
return domdoc_load_from_stream(This, (ISequentialStream*)stream);
return This->error = domdoc_load_from_stream(This, (ISequentialStream*)stream);
}
static HRESULT WINAPI PersistStreamInit_Save(

View file

@ -2181,6 +2181,7 @@ static void test_persiststream(void)
IXMLDOMDocument *doc;
ULARGE_INTEGER size;
IPersist *persist;
IStream *istream;
HRESULT hr;
CLSID clsid;
@ -2214,6 +2215,21 @@ static void test_persiststream(void)
ok(IsEqualGUID(&clsid, &CLSID_DOMDocument2), "wrong clsid %s\n", wine_dbgstr_guid(&clsid));
IPersistStream_Release(stream);
/* test Load */
istream = SHCreateMemStream((const BYTE*)complete4A, strlen(complete4A));
hr = IPersistStreamInit_Load(streaminit, istream);
ok(hr == S_OK, "got 0x%08x\n", hr);
IStream_Release(istream);
EXPECT_PARSE_ERROR(doc, S_OK, FALSE);
istream = SHCreateMemStream((const BYTE*)"", 0);
hr = IPersistStreamInit_Load(streaminit, istream);
todo_wine ok(hr == XML_E_MISSINGROOT, "got 0x%08x\n", hr);
ok(FAILED(hr), "got success\n");
IStream_Release(istream);
EXPECT_PARSE_ERROR(doc, XML_E_MISSINGROOT, TRUE);
IPersistStreamInit_Release(streaminit);
IXMLDOMDocument_Release(doc);
}