Skip to content
Snippets Groups Projects
Commit 617f6908 authored by Gerard Patel's avatar Gerard Patel Committed by Alexandre Julliard
Browse files

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

parent 0b16006b
Branches
Tags
No related merge requests found
......@@ -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.
......
......@@ -336,6 +336,7 @@ HRESULT WINAPI StorageBaseImpl_OpenStream(
if (newStream!=0)
{
newStream->grfMode = grfMode;
*ppstm = (IStream*)newStream;
/*
......
......@@ -626,7 +626,7 @@ struct StgStreamImpl
*/
BlockChainStream* bigBlockChain;
SmallBlockChainStream* smallBlockChain;
DWORD grfMode;
};
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment