Allow ISequentialStream_Write to work if access mode is STGM_READWRITE.

This commit is contained in:
Huw D M Davies 2000-05-03 17:39:21 +00:00 committed by Alexandre Julliard
parent 5b8eb2d838
commit bdee212058
1 changed files with 6 additions and 8 deletions

View File

@ -414,8 +414,12 @@ HRESULT WINAPI StgStreamImpl_Write(
TRACE("(%p, %p, %ld, %p)\n",
iface, pv, cb, pcbWritten);
if (!(This->grfMode & STGM_WRITE))
return STG_E_ACCESSDENIED;
/*
* Do we have permission to write to this stream?
*/
if (!(This->grfMode & (STGM_WRITE | STGM_READWRITE))) {
return STG_E_ACCESSDENIED;
}
/*
* If the caller is not interested in the number of bytes written,
@ -429,12 +433,6 @@ HRESULT WINAPI StgStreamImpl_Write(
*/
*pcbWritten = 0;
/*
* Do we have permission to write to this stream?
*/
if (!(This->grfMode & (STGM_WRITE | STGM_READWRITE)))
return STG_E_ACCESSDENIED;
if (cb == 0)
{
return S_OK;