Returns an error if trying to write to a stream opened for read.

This commit is contained in:
Gerard Patel 2000-01-26 02:04:44 +00:00 committed by Alexandre Julliard
parent 0b16006b73
commit 617f6908de
3 changed files with 6 additions and 2 deletions

View File

@ -411,7 +411,10 @@ HRESULT WINAPI StgStreamImpl_Write(
TRACE("(%p, %p, %ld, %p)\n",
iface, pv, cb, pcbWritten);
if (!(This->grfMode & STGM_WRITE))
return STG_E_ACCESSDENIED;
/*
* If the caller is not interested in the number of bytes written,
* we use another buffer to avoid "if" statements in the code.

View File

@ -336,6 +336,7 @@ HRESULT WINAPI StorageBaseImpl_OpenStream(
if (newStream!=0)
{
newStream->grfMode = grfMode;
*ppstm = (IStream*)newStream;
/*

View File

@ -626,7 +626,7 @@ struct StgStreamImpl
*/
BlockChainStream* bigBlockChain;
SmallBlockChainStream* smallBlockChain;
DWORD grfMode;
};
/*