Vincent Povirk : ole32: Reread the stream entry after setting the size in StreamWriteAt.

Alexandre Julliard julliard at winehq.org
Mon Dec 21 09:39:47 CST 2009


Module: wine
Branch: master
Commit: b3511ebb70072d8615d09db638e47e9f3d86fcfc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b3511ebb70072d8615d09db638e47e9f3d86fcfc

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Sat Dec 19 14:20:02 2009 -0600

ole32: Reread the stream entry after setting the size in StreamWriteAt.

In simple mode, StreamWriteAt would assume that StreamSetSize uses the size
it asks for, but in some cases the size would be pushed above the small block
limit. StreamWriteAt would then attempt to write using a small block chain,
even though a big block chain was created.

---

 dlls/ole32/storage32.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index ef71e6f..629709a 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -2475,7 +2475,8 @@ static HRESULT StorageImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index,
     if (FAILED(hr))
       return hr;
 
-    data.size = newSize;
+    hr = StorageImpl_ReadDirEntry(This, index, &data);
+    if (FAILED(hr)) return hr;
   }
 
   if (data.size.QuadPart < LIMIT_TO_USE_SMALL_BLOCK)




More information about the wine-cvs mailing list