ole32: Fix excessive file sizes for Storage files.
commit1be295fb471fdd0606f0d57cce22804dd7a1086c
authorTroy Rollo <wine@troy.rollo.name>
Tue, 23 May 2006 01:42:25 +0000 (23 11:42 +1000)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 23 May 2006 11:00:13 +0000 (23 13:00 +0200)
tree4ab48e595e3e6507942ce4d0fe4c8e9eebd89d04
parent3b95aad5059b6ea1caba1a5d6e3a1d7ef30ad06a
ole32: Fix excessive file sizes for Storage files.

The IStorage (DocFile) implementation was adding empty blocks at the
end of the file every time a caller wrote data that was not a multiple
of 512 bytes.  If the caller made a lot of very small writes the file
size could be huge even though the data in the file was tiny. This was
caused by BlockChainStream_SetSize trying to allocate file blocks for
the new data using a condition that bore no relationship to the
required condition, and it was not necessary to do so at that time
since it is done (the right way) by StorageImpl_GetNextFreeBigBlock
(called via BlockChainStream_Enlarge).
dlls/ole32/storage32.c