Commit 8f604e92 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ole: Fix mis-handling of return value in StgStreamImpl_Read.

BlockChainStream_ReadAt returns a BOOL, not an HRESULT so change StgStreamImpl_Read to handle this, by returning STG_E_READFAULT on failure.
parent 03060551
......@@ -249,7 +249,7 @@ static HRESULT WINAPI StgStreamImpl_Read(
ULONG bytesReadBuffer;
ULONG bytesToReadFromBuffer;
HRESULT res = S_FALSE;
HRESULT res;
TRACE("(%p, %p, %ld, %p)\n",
iface, pv, cb, pcbRead);
......@@ -282,11 +282,15 @@ static HRESULT WINAPI StgStreamImpl_Read(
}
else if (This->bigBlockChain!=0)
{
res = BlockChainStream_ReadAt(This->bigBlockChain,
This->currentPosition,
bytesToReadFromBuffer,
pv,
pcbRead);
BOOL success = BlockChainStream_ReadAt(This->bigBlockChain,
This->currentPosition,
bytesToReadFromBuffer,
pv,
pcbRead);
if (success)
res = S_OK;
else
res = STG_E_READFAULT;
}
else
{
......
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