ole32: Forbid renaming an open storage.
This commit is contained in:
parent
c62a4ad841
commit
8569d547b9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue