ole32: Fix the HGLOBAL stream IStream_Read function to return S_OK even if not all of the requested bytes were available.

This commit is contained in:
Robert Shearman 2006-09-11 11:11:56 +01:00 committed by Alexandre Julliard
parent e10103e3ec
commit a552c2ead7
2 changed files with 2 additions and 7 deletions

View File

@ -255,14 +255,11 @@ static HRESULT WINAPI HGLOBALStreamImpl_Read(
GlobalUnlock(This->supportHandle);
/*
* The function returns S_OK if the buffer was filled completely
* it returns S_FALSE if the end of the stream is reached before the
* Always returns S_OK even if the end of the stream is reached before the
* buffer is filled
*/
if(*pcbRead == cb)
return S_OK;
return S_FALSE;
return S_OK;
}
/***

View File

@ -53,9 +53,7 @@ static void test_streamonhglobal(IStream *pStream)
/* should return S_OK, not S_FALSE */
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
todo_wine {
ok_ole_success(hr, "IStream_Read");
}
ok(read == sizeof(data), "IStream_Read returned read %ld instead of %d\n", read, sizeof(data));
/* ignores HighPart */