Commit da3893fe authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msxml3: Set internal error on loading from IPersistStream.

parent 50650c26
...@@ -824,7 +824,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream ...@@ -824,7 +824,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream
if (!stream) if (!stream)
return E_INVALIDARG; 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( static HRESULT WINAPI PersistStreamInit_Save(
......
...@@ -2181,6 +2181,7 @@ static void test_persiststream(void) ...@@ -2181,6 +2181,7 @@ static void test_persiststream(void)
IXMLDOMDocument *doc; IXMLDOMDocument *doc;
ULARGE_INTEGER size; ULARGE_INTEGER size;
IPersist *persist; IPersist *persist;
IStream *istream;
HRESULT hr; HRESULT hr;
CLSID clsid; CLSID clsid;
...@@ -2214,6 +2215,21 @@ static void test_persiststream(void) ...@@ -2214,6 +2215,21 @@ static void test_persiststream(void)
ok(IsEqualGUID(&clsid, &CLSID_DOMDocument2), "wrong clsid %s\n", wine_dbgstr_guid(&clsid)); ok(IsEqualGUID(&clsid, &CLSID_DOMDocument2), "wrong clsid %s\n", wine_dbgstr_guid(&clsid));
IPersistStream_Release(stream); 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); IPersistStreamInit_Release(streaminit);
IXMLDOMDocument_Release(doc); IXMLDOMDocument_Release(doc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment