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

This commit is contained in:
Vincent Povirk 2009-05-29 16:45:44 -05:00 committed by Alexandre Julliard
parent 93a155381f
commit e21adbf45a
2 changed files with 5 additions and 2 deletions

View File

@ -1797,6 +1797,9 @@ static HRESULT WINAPI StorageImpl_DestroyElement(
if (pwcsName==NULL) if (pwcsName==NULL)
return STG_E_INVALIDPOINTER; 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 * Create a property enumeration to search the property with the given name
*/ */

View File

@ -1328,11 +1328,11 @@ void test_readonly(void)
/* DestroyElement on read-only storage, name exists */ /* DestroyElement on read-only storage, name exists */
hr = IStorage_DestroyElement( stg2, streamW ); 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 */ /* DestroyElement on read-only storage, name does not exist */
hr = IStorage_DestroyElement( stg2, storageW ); 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); IStorage_Release(stg2);
} }