ole32: Forbid renaming an open storage.

This commit is contained in:
Vincent Povirk 2009-11-19 13:57:43 -06:00 committed by Alexandre Julliard
parent c62a4ad841
commit 8569d547b9
2 changed files with 4 additions and 3 deletions

View File

@ -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;
}

View File

@ -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