Nikolay Sivov : xmllite/writer: Properly fail on initial state in WriteEndElement().

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 23 11:21:02 CDT 2016


Module: wine
Branch: master
Commit: 6ca1ebdd25756a797c55c4d10b91b3bab61b646d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6ca1ebdd25756a797c55c4d10b91b3bab61b646d

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Mar 23 13:07:28 2016 +0300

xmllite/writer: Properly fail on initial state in WriteEndElement().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;




More information about the wine-cvs mailing list