ole32: Flush before returning from any storage API call that writes.

This commit is contained in:
Vincent Povirk 2010-08-25 14:55:21 -05:00 committed by Alexandre Julliard
parent 9ea1d13d14
commit 101de22a1a
2 changed files with 17 additions and 2 deletions

View File

@ -295,6 +295,9 @@ static HRESULT WINAPI StgStreamImpl_Write(
*/
This->currentPosition.u.LowPart += *pcbWritten;
if (SUCCEEDED(res))
res = StorageBaseImpl_Flush(This->parentStorage);
TRACE("<-- S_OK, written %u\n", *pcbWritten);
return res;
}
@ -417,6 +420,10 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
}
hr = StorageBaseImpl_StreamSetSize(This->parentStorage, This->dirEntry, libNewSize);
if (SUCCEEDED(hr))
hr = StorageBaseImpl_Flush(This->parentStorage);
return hr;
}

View File

@ -856,7 +856,7 @@ static HRESULT WINAPI StorageBaseImpl_RenameElement(
return STG_E_FILENOTFOUND;
}
return S_OK;
return StorageBaseImpl_Flush(This);
}
/************************************************************************
@ -1011,7 +1011,7 @@ static HRESULT WINAPI StorageBaseImpl_CreateStream(
return STG_E_INSUFFICIENTMEMORY;
}
return S_OK;
return StorageBaseImpl_Flush(This);
}
/************************************************************************
@ -1047,6 +1047,9 @@ static HRESULT WINAPI StorageBaseImpl_SetClass(
&currentEntry);
}
if (SUCCEEDED(hRes))
hRes = StorageBaseImpl_Flush(This);
return hRes;
}
@ -1203,6 +1206,8 @@ static HRESULT WINAPI StorageBaseImpl_CreateStorage(
return hr;
}
if (SUCCEEDED(hr))
hr = StorageBaseImpl_Flush(This);
return S_OK;
}
@ -1916,6 +1921,9 @@ static HRESULT WINAPI StorageBaseImpl_DestroyElement(
if (SUCCEEDED(hr))
StorageBaseImpl_DestroyDirEntry(This, entryToDeleteRef);
if (SUCCEEDED(hr))
hr = StorageBaseImpl_Flush(This);
return hr;
}