Esme Povirk (@madewokherd) commented about dlls/ole32/filelockbytes.c:
static HRESULT WINAPI FileLockBytesImpl_Flush(ILockBytes* iface) {
- FileLockBytesImpl *This = impl_from_ILockBytes(iface);
- TRACE("(%p)\n", iface);
- /* verify a sane environment */
- if (!This) return E_FAIL;
- if (!FlushFileBuffers(This->hfile))
return STG_E_WRITEFAULT;
According to MSDN, this will fail if the file isn't opened with write permission (which, I think, shows that the tests aren't testing what you want).