From 6ca1ebdd25756a797c55c4d10b91b3bab61b646d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 23 Mar 2016 13:07:28 +0300 Subject: [PATCH] xmllite/writer: Properly fail on initial state in WriteEndElement(). Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- 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 e6ffbeb008e..a5d5b31a22b 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 90e965f7c20..0e55b42038e 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;