mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
IStream_fnWrite: only return write count if the given pointer
parameter is not NULL.
This commit is contained in:
parent
b89525fb06
commit
87326ba7c3
@ -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)
|
static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
|
||||||
{
|
{
|
||||||
|
DWORD dummy_count;
|
||||||
ICOM_THIS(ISHFileStream, iface);
|
ICOM_THIS(ISHFileStream, iface);
|
||||||
|
|
||||||
TRACE("(%p)\n",This);
|
TRACE("(%p)\n",This);
|
||||||
@ -205,6 +206,10 @@ static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb
|
|||||||
if( !pv )
|
if( !pv )
|
||||||
return STG_E_INVALIDPOINTER;
|
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 ) )
|
if( ! WriteFile( This->handle, pv, cb, pcbWritten, NULL ) )
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user