mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
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:
parent
50650c26fe
commit
da3893fe48
2 changed files with 17 additions and 1 deletions
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue