Vincent Povirk : ole32: Discard existing data when creating a new storage on an ILockBytes.

Alexandre Julliard julliard at winehq.org
Tue Sep 13 12:18:08 CDT 2011


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Mon Sep 12 12:50:18 2011 -0500

ole32: Discard existing data when creating a new storage on an ILockBytes.

---

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

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index e983bf3..69a00cd 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -2740,6 +2740,10 @@ static HRESULT StorageImpl_Construct(
     ULARGE_INTEGER size;
     BYTE bigBlockBuffer[MAX_BIG_BLOCK_SIZE];
 
+    /* Discard any existing data. */
+    size.QuadPart = 0;
+    ILockBytes_SetSize(This->lockBytes, size);
+
     /*
      * Initialize all header variables:
      * - The big block depot consists of one block and it is at block 0
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index d0e5236..b8c6ada 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -2971,7 +2971,7 @@ static void test_hglobal_storage_creation(void)
 
     r = StgOpenStorageOnILockBytes(ilb, NULL, STGM_READ|STGM_SHARE_EXCLUSIVE,
         NULL, 0, &stg);
-    todo_wine ok(r == S_OK, "StgOpenStorageOnILockBytes failed, hr=%x\n", r);
+    ok(r == S_OK, "StgOpenStorageOnILockBytes failed, hr=%x\n", r);
 
     if (SUCCEEDED(r))
     {




More information about the wine-cvs mailing list