diff --git a/reactos/lib/ole32/hglobalstream.c b/reactos/lib/ole32/hglobalstream.c index ca73a224228..4d1d4b5ebfb 100644 --- a/reactos/lib/ole32/hglobalstream.c +++ b/reactos/lib/ole32/hglobalstream.c @@ -313,7 +313,12 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( if (newSize.u.LowPart > This->streamSize.u.LowPart) { /* grow stream */ - IStream_SetSize(iface, newSize); + HRESULT hr = IStream_SetSize(iface, newSize); + if (FAILED(hr)) + { + ERR("IStream_SetSize failed with error 0x%08lx\n", hr); + return hr; + } } /* diff --git a/reactos/lib/ole32/stg_stream.c b/reactos/lib/ole32/stg_stream.c index 40f0e81b93d..19b8bda5a7d 100644 --- a/reactos/lib/ole32/stg_stream.c +++ b/reactos/lib/ole32/stg_stream.c @@ -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 {