Commit 87326ba7 authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard

IStream_fnWrite: only return write count if the given pointer

parameter is not NULL.
parent b89525fb
......@@ -198,6 +198,7 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG
static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
{
DWORD dummy_count;
ICOM_THIS(ISHFileStream, iface);
TRACE("(%p)\n",This);
......@@ -205,6 +206,10 @@ static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb
if( !pv )
return STG_E_INVALIDPOINTER;
/* WriteFile() doesn't allow to specify NULL as write count pointer */
if (!pcbWritten)
pcbWritten = &dummy_count;
if( ! WriteFile( This->handle, pv, cb, pcbWritten, NULL ) )
return E_FAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment