[PATCH 2/2] msxml3: Set internal error on loading from IPersistStream.
Daniel Lehman
dlehman25 at gmail.com
Fri Jun 12 00:27:47 CDT 2020
Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
dlls/msxml3/domdoc.c | 2 +-
dlls/msxml3/tests/domdoc.c | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index c86a4931c5..b740b2e9d3 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -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(
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 436f2a489f..a6e44a8932 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -2181,7 +2181,9 @@ static void test_persiststream(void)
IPersistStream *stream;
IXMLDOMDocument *doc;
ULARGE_INTEGER size;
+ char path[MAX_PATH];
IPersist *persist;
+ IStream *istream;
HRESULT hr;
CLSID clsid;
@@ -2215,6 +2217,26 @@ static void test_persiststream(void)
ok(IsEqualGUID(&clsid, &CLSID_DOMDocument2), "wrong clsid %s\n", wine_dbgstr_guid(&clsid));
IPersistStream_Release(stream);
+
+ /* test Load */
+ GetTempPathA(MAX_PATH, path);
+ strcat(path, "winetest.xml");
+ write_to_file(path, complete4A);
+ create_stream_on_file(&istream, path);
+ hr = IPersistStreamInit_Load(streaminit, istream);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ IStream_Release(istream);
+ EXPECT_PARSE_ERROR(doc, S_OK, FALSE);
+
+ write_to_file(path, "");
+ create_stream_on_file(&istream, path);
+ 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);
+ DeleteFileA(path);
+
IPersistStreamInit_Release(streaminit);
IXMLDOMDocument_Release(doc);
}
--
2.17.1
More information about the wine-devel
mailing list