ole32: Don't fail if the file ends during a big block.

Apparently, it's valid for the last block in a file to be incomplete.
This commit is contained in:
Vincent Povirk 2010-09-07 19:17:43 -05:00 committed by Alexandre Julliard
parent 053be78e39
commit 2752c3bcd0
1 changed files with 9 additions and 2 deletions

View File

@ -3875,13 +3875,20 @@ static BOOL StorageImpl_ReadBigBlock(
void* buffer)
{
ULARGE_INTEGER ulOffset;
DWORD read;
DWORD read=0;
ulOffset.u.HighPart = 0;
ulOffset.u.LowPart = StorageImpl_GetBigBlockOffset(This, blockIndex);
StorageImpl_ReadAt(This, ulOffset, buffer, This->bigBlockSize, &read);
return (read == This->bigBlockSize);
if (read && read < This->bigBlockSize)
{
/* File ends during this block; fill the rest with 0's. */
memset((LPBYTE)buffer+read, 0, This->bigBlockSize-read);
}
return (read != 0);
}
static BOOL StorageImpl_ReadDWordFromBigBlock(