Commit 809959de authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: It's not a failure to get S_FALSE from IStream::Read().

parent 835171c2
......@@ -1873,14 +1873,14 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt
HRESULT hr;
ULONG dataRead;
char data[1024];
int ret;
dataRead = 0;
hr = IStream_Read(stream, data, sizeof(data), &dataRead);
if(hr != S_OK)
return hr;
if(FAILED(hr)) return hr;
hr = SAXLocator_create(This, &locator, vbInterface);
if(FAILED(hr))
return hr;
if(FAILED(hr)) return hr;
locator->pParserCtxt = xmlCreatePushParserCtxt(
&locator->saxreader->sax, locator,
......@@ -1892,25 +1892,34 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt
}
This->isParsing = TRUE;
if(dataRead != sizeof(data))
{
ret = xmlParseChunk(locator->pParserCtxt, data, 0, 1);
hr = ret != XML_ERR_OK ? E_FAIL : locator->ret;
}
else
{
while(1)
{
dataRead = 0;
hr = IStream_Read(stream, data, sizeof(data), &dataRead);
if(hr != S_OK)
break;
if (FAILED(hr)) break;
if(xmlParseChunk(locator->pParserCtxt, data, dataRead, 0) != XML_ERR_OK) hr = E_FAIL;
else hr = locator->ret;
ret = xmlParseChunk(locator->pParserCtxt, data, dataRead, 0);
hr = ret != XML_ERR_OK ? E_FAIL : locator->ret;
if(hr != S_OK) break;
if (hr != S_OK) break;
if(dataRead != sizeof(data))
if (dataRead != sizeof(data))
{
if(xmlParseChunk(locator->pParserCtxt, data, 0, 1) != XML_ERR_OK) hr = E_FAIL;
else hr = locator->ret;
ret = xmlParseChunk(locator->pParserCtxt, data, 0, 1);
hr = ret != XML_ERR_OK ? E_FAIL : locator->ret;
break;
}
}
}
This->isParsing = FALSE;
xmlFreeParserCtxt(locator->pParserCtxt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment