Rob Shearman : ole32: Reset the parent storage on overwritten streams so that operations on them now fail .

Alexandre Julliard julliard at winehq.org
Mon Oct 22 09:55:17 CDT 2007


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Fri Oct 19 23:23:17 2007 +0100

ole32: Reset the parent storage on overwritten streams so that operations on them now fail.

---

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

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index c627a43..4bea165 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -1015,6 +1015,17 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
      */
     if (STGM_CREATE_MODE(grfMode) == STGM_CREATE)
     {
+      StgStreamImpl *strm;
+
+      LIST_FOR_EACH_ENTRY(strm, &This->strmHead, StgStreamImpl, StrmListEntry)
+      {
+        if (strm->ownerProperty == foundPropertyIndex)
+        {
+          TRACE("Stream deleted %p\n", strm);
+          strm->parentStorage = NULL;
+          list_remove(&strm->StrmListEntry);
+        }
+      }
       IStorage_DestroyElement(iface, pwcsName);
     }
     else
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index 8e6502c..7dc633c 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -335,7 +335,6 @@ static void test_storage_stream(void)
     ok(r==S_OK, "IStorage->CreateStream failed\n");
 
     r = IStream_Seek(stm, pos, STREAM_SEEK_SET, &p);
-    todo_wine
     ok(r==STG_E_REVERTED, "overwritten stream should return STG_E_REVERTED instead of 0x%08x\n", r);
 
     r = IStream_Release(stm2);




More information about the wine-cvs mailing list