ole32: Reset the parent storage on overwritten streams so that operations on them now fail.

This commit is contained in:
Rob Shearman 2007-10-19 23:23:17 +01:00 committed by Alexandre Julliard
parent 842d1b698d
commit 5ce2d25b32
2 changed files with 11 additions and 1 deletions

View File

@ -1015,6 +1015,17 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
*/
if (STGM_CREATE_MODE(grfMode) == STGM_CREATE)
{
StgStreamImpl *strm;
LIST_FOR_EACH_ENTRY(strm, &This->strmHead, StgStreamImpl, StrmListEntry)
{
if (strm->ownerProperty == foundPropertyIndex)
{
TRACE("Stream deleted %p\n", strm);
strm->parentStorage = NULL;
list_remove(&strm->StrmListEntry);
}
}
IStorage_DestroyElement(iface, pwcsName);
}
else

View File

@ -335,7 +335,6 @@ static void test_storage_stream(void)
ok(r==S_OK, "IStorage->CreateStream failed\n");
r = IStream_Seek(stm, pos, STREAM_SEEK_SET, &p);
todo_wine
ok(r==STG_E_REVERTED, "overwritten stream should return STG_E_REVERTED instead of 0x%08x\n", r);
r = IStream_Release(stm2);