ole32: Do not allow renaming streams that are open.
This commit is contained in:
parent
371f6a4818
commit
52100e9620
|
@ -731,6 +731,12 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
|
|||
|
||||
if (currentEntryRef != DIRENTRY_NULL)
|
||||
{
|
||||
if (StorageBaseImpl_IsStreamOpen(This, currentEntryRef))
|
||||
{
|
||||
WARN("Stream is already open; cannot rename.\n");
|
||||
return STG_E_ACCESSDENIED;
|
||||
}
|
||||
|
||||
/* Remove the element from its current position in the tree */
|
||||
removeFromTree(This->ancestorStorage, This->storageDirEntry,
|
||||
currentEntryRef);
|
||||
|
|
|
@ -1113,7 +1113,7 @@ static void test_substorage_share(void)
|
|||
|
||||
/* cannot rename the stream while it's open */
|
||||
r = IStorage_RenameElement(stg, stmname, 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, stmname);
|
||||
|
||||
/* destroying an object while it's open invalidates it */
|
||||
|
|
Loading…
Reference in New Issue