Module: wine Branch: master Commit: 8569d547b986c84a924836bb84a9ecfd14a65fbe URL: http://source.winehq.org/git/wine.git/?a=commit;h=8569d547b986c84a924836bb84...
Author: Vincent Povirk vincent@codeweavers.com Date: Thu Nov 19 13:57:43 2009 -0600
ole32: Forbid renaming an open storage.
---
dlls/ole32/storage32.c | 5 +++-- dlls/ole32/tests/storage32.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 773855f..4e667c6 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -765,9 +765,10 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
if (currentEntryRef != DIRENTRY_NULL) { - if (StorageBaseImpl_IsStreamOpen(This, currentEntryRef)) + if (StorageBaseImpl_IsStreamOpen(This, currentEntryRef) || + StorageBaseImpl_IsStorageOpen(This, currentEntryRef)) { - WARN("Stream is already open; cannot rename.\n"); + WARN("Element is already open; cannot rename.\n"); return STG_E_ACCESSDENIED; }
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index 42741ac..05d1473 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -1073,7 +1073,7 @@ static void test_substorage_share(void)
/* cannot rename the storage while it's open */ r = IStorage_RenameElement(stg, stgname, 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, stgname);
#if 0