Vincent Povirk : ole32: Invalidate open storage objects that are deleted.
Alexandre Julliard
julliard at winehq.org
Fri Nov 20 10:48:01 CST 2009
Module: wine
Branch: master
Commit: 669af158dadf3635abcae95a72f3570ebe28a8f0
URL: http://source.winehq.org/git/wine.git/?a=commit;h=669af158dadf3635abcae95a72f3570ebe28a8f0
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Thu Nov 19 14:02:23 2009 -0600
ole32: Invalidate open storage objects that are deleted.
---
dlls/ole32/storage32.c | 10 ++++++++++
dlls/ole32/tests/storage32.c | 6 +-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c
index 4e667c6..708f263 100644
--- a/dlls/ole32/storage32.c
+++ b/dlls/ole32/storage32.c
@@ -1936,6 +1936,16 @@ static HRESULT deleteStorageContents(
STATSTG currentElement;
HRESULT hr;
HRESULT destroyHr = S_OK;
+ StorageInternalImpl *stg, *stg2;
+
+ /* Invalidate any open storage objects. */
+ LIST_FOR_EACH_ENTRY_SAFE(stg, stg2, &parentStorage->storageHead, StorageInternalImpl, ParentListEntry)
+ {
+ if (stg->base.storageDirEntry == indexToDelete)
+ {
+ StorageInternalImpl_Invalidate(stg);
+ }
+ }
/*
* Open the storage and enumerate it
diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c
index 05d1473..53811db 100644
--- a/dlls/ole32/tests/storage32.c
+++ b/dlls/ole32/tests/storage32.c
@@ -1076,19 +1076,15 @@ static void test_substorage_share(void)
ok(r==STG_E_ACCESSDENIED, "IStorage->RenameElement should fail %08x\n", r);
if (SUCCEEDED(r)) IStorage_RenameElement(stg, othername, stgname);
-#if 0
- /* This crashes on Wine. */
-
/* destroying an object while it's open invalidates it */
r = IStorage_DestroyElement(stg, stgname);
ok(r==S_OK, "IStorage->DestroyElement failed, hr=%08x\n", r);
r = IStorage_CreateStream(stg2, stmname, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
- todo_wine ok(r==STG_E_REVERTED, "IStorage->CreateStream failed, hr=%08x\n", r);
+ ok(r==STG_E_REVERTED, "IStorage->CreateStream failed, hr=%08x\n", r);
if (r == S_OK)
IStorage_Release(stm);
-#endif
IStorage_Release(stg2);
}
More information about the wine-cvs
mailing list