[PATCH 3/4] xmllite/writer: Properly fail on initial state in WriteEndElement()
Nikolay Sivov
nsivov at codeweavers.com
Wed Mar 23 05:07:28 CDT 2016
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/xmllite/tests/writer.c | 1 -
dlls/xmllite/writer.c | 8 ++++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/xmllite/tests/writer.c b/dlls/xmllite/tests/writer.c
index e6ffbeb..a5d5b31a 100644
--- a/dlls/xmllite/tests/writer.c
+++ b/dlls/xmllite/tests/writer.c
@@ -89,7 +89,6 @@ todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
hr = IXmlWriter_WriteEndElement(writer);
-todo_wine
ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr);
todo_wine {
diff --git a/dlls/xmllite/writer.c b/dlls/xmllite/writer.c
index 90e965f..0e55b42 100644
--- a/dlls/xmllite/writer.c
+++ b/dlls/xmllite/writer.c
@@ -784,6 +784,14 @@ static HRESULT WINAPI xmlwriter_WriteEndElement(IXmlWriter *iface)
TRACE("%p\n", This);
+ switch (This->state)
+ {
+ case XmlWriterState_Initial:
+ return E_UNEXPECTED;
+ default:
+ ;
+ }
+
element = pop_element(This);
if (!element)
return WR_E_INVALIDACTION;
--
2.7.0
More information about the wine-patches
mailing list