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

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-03-23 13:07:28 +03:00 committed by Alexandre Julliard
parent 86a7dd99e0
commit 6ca1ebdd25
2 changed files with 8 additions and 1 deletions

View File

@ -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 {

View File

@ -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;