Commit 101de22a authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

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

parent 9ea1d13d
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment