Commit 8569d547 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

ole32: Forbid renaming an open storage.

parent c62a4ad8
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment