From d6ba637bf3e9ad3cc3edd0fd600877436d8106cf Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Fri, 29 May 2009 16:45:44 -0500 Subject: [PATCH] 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 af1e3b1..2761507 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); } -- 1.5.4.3