Vincent Povirk : ole32: Do not allow renaming streams that are open.

Alexandre Julliard julliard at winehq.org
Thu Nov 19 10:15:19 CST 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Nov 18 11:19:18 2009 -0600

ole32: Do not allow renaming streams that are open.

---

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

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 23b47ad..8613aa8 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -731,6 +731,12 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
 
   if (currentEntryRef != DIRENTRY_NULL)
   {
+    if (StorageBaseImpl_IsStreamOpen(This, currentEntryRef))
+    {
+      WARN("Stream is already open; cannot rename.\n");
+      return STG_E_ACCESSDENIED;
+    }
+
     /* Remove the element from its current position in the tree */
     removeFromTree(This->ancestorStorage, This->storageDirEntry,
         currentEntryRef);
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index 10767e1..75c0dae 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -1113,7 +1113,7 @@ static void test_substorage_share(void)
 
         /* cannot rename the stream while it's open */
         r = IStorage_RenameElement(stg, stmname, othername);
-        todo_wine ok(r==STG_E_ACCESSDENIED, "IStorage->RenameElement should fail %08x\n", r);
+        ok(r==STG_E_ACCESSDENIED, "IStorage->RenameElement should fail %08x\n", r);
         if (SUCCEEDED(r)) IStorage_RenameElement(stg, othername, stmname);
 
         /* destroying an object while it's open invalidates it */




More information about the wine-cvs mailing list