Returns an error if trying to write to a stream opened for read.
This commit is contained in:
parent
0b16006b73
commit
617f6908de
|
@ -411,7 +411,10 @@ HRESULT WINAPI StgStreamImpl_Write(
|
||||||
|
|
||||||
TRACE("(%p, %p, %ld, %p)\n",
|
TRACE("(%p, %p, %ld, %p)\n",
|
||||||
iface, pv, cb, pcbWritten);
|
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,
|
* If the caller is not interested in the number of bytes written,
|
||||||
* we use another buffer to avoid "if" statements in the code.
|
* we use another buffer to avoid "if" statements in the code.
|
||||||
|
|
|
@ -336,6 +336,7 @@ HRESULT WINAPI StorageBaseImpl_OpenStream(
|
||||||
|
|
||||||
if (newStream!=0)
|
if (newStream!=0)
|
||||||
{
|
{
|
||||||
|
newStream->grfMode = grfMode;
|
||||||
*ppstm = (IStream*)newStream;
|
*ppstm = (IStream*)newStream;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -626,7 +626,7 @@ struct StgStreamImpl
|
||||||
*/
|
*/
|
||||||
BlockChainStream* bigBlockChain;
|
BlockChainStream* bigBlockChain;
|
||||||
SmallBlockChainStream* smallBlockChain;
|
SmallBlockChainStream* smallBlockChain;
|
||||||
|
DWORD grfMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue