Vincent Povirk : ole32: Fix return code of DeleteStorage for read only storage.

Alexandre Julliard julliard at winehq.org
Mon Jun 1 10:01:01 CDT 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Fri May 29 16:45:44 2009 -0500

ole32: Fix return code of DeleteStorage for read only storage.

---

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

diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 9f3930e..ff95fad 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -1797,6 +1797,9 @@ static HRESULT WINAPI StorageImpl_DestroyElement(
   if (pwcsName==NULL)
     return STG_E_INVALIDPOINTER;
 
+  if ( STGM_ACCESS_MODE( This->base.openFlags ) == STGM_READ )
+    return STG_E_ACCESSDENIED;
+
   /*
    * Create a property enumeration to search the property with the given name
    */
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index 84c4b0f..55f7145 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -1328,11 +1328,11 @@ void test_readonly(void)
 
             /* DestroyElement on read-only storage, name exists */
             hr = IStorage_DestroyElement( stg2, streamW );
-            todo_wine ok(hr == STG_E_ACCESSDENIED, "should fail, res=%x\n", hr);
+            ok(hr == STG_E_ACCESSDENIED, "should fail, res=%x\n", hr);
 
             /* DestroyElement on read-only storage, name does not exist */
             hr = IStorage_DestroyElement( stg2, storageW );
-            todo_wine ok(hr == STG_E_ACCESSDENIED, "should fail, res=%x\n", hr);
+            ok(hr == STG_E_ACCESSDENIED, "should fail, res=%x\n", hr);
 
             IStorage_Release(stg2);
         }




More information about the wine-cvs mailing list