Commit a552c2ea authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ole32: Fix the HGLOBAL stream IStream_Read function to return S_OK even if not…

ole32: Fix the HGLOBAL stream IStream_Read function to return S_OK even if not all of the requested bytes were available.
parent e10103e3
...@@ -255,14 +255,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read( ...@@ -255,14 +255,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read(
GlobalUnlock(This->supportHandle); GlobalUnlock(This->supportHandle);
/* /*
* The function returns S_OK if the buffer was filled completely * Always returns S_OK even if the end of the stream is reached before the
* it returns S_FALSE if the end of the stream is reached before the
* buffer is filled * buffer is filled
*/ */
if(*pcbRead == cb)
return S_OK;
return S_FALSE; return S_OK;
} }
/*** /***
......
...@@ -53,9 +53,7 @@ static void test_streamonhglobal(IStream *pStream) ...@@ -53,9 +53,7 @@ static void test_streamonhglobal(IStream *pStream)
/* should return S_OK, not S_FALSE */ /* should return S_OK, not S_FALSE */
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read); hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
todo_wine {
ok_ole_success(hr, "IStream_Read"); ok_ole_success(hr, "IStream_Read");
}
ok(read == sizeof(data), "IStream_Read returned read %ld instead of %d\n", read, sizeof(data)); ok(read == sizeof(data), "IStream_Read returned read %ld instead of %d\n", read, sizeof(data));
/* ignores HighPart */ /* ignores HighPart */
......
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