Commit 8dc5bd8e authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

ole32: Always set pcbWritten when writing a stream.

parent f205eca5
...@@ -287,8 +287,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( ...@@ -287,8 +287,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write(
ULARGE_INTEGER newSize; ULARGE_INTEGER newSize;
ULONG bytesWritten = 0; ULONG bytesWritten = 0;
TRACE("(%p, %p, %ld, %p)\n", iface, TRACE("(%p, %p, %ld, %p)\n", iface, pv, cb, pcbWritten);
pv, cb, pcbWritten);
/* /*
* If the caller is not interested in the number of bytes written, * If the caller is not interested in the number of bytes written,
...@@ -298,14 +297,10 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( ...@@ -298,14 +297,10 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write(
pcbWritten = &bytesWritten; pcbWritten = &bytesWritten;
if (cb == 0) if (cb == 0)
{ goto out;
return S_OK;
}
else
{
newSize.u.HighPart = 0; newSize.u.HighPart = 0;
newSize.u.LowPart = This->currentPosition.u.LowPart + cb; newSize.u.LowPart = This->currentPosition.u.LowPart + cb;
}
/* /*
* Verify if we need to grow the stream * Verify if we need to grow the stream
...@@ -334,14 +329,15 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write( ...@@ -334,14 +329,15 @@ static HRESULT WINAPI HGLOBALStreamImpl_Write(
This->currentPosition.u.LowPart+=cb; This->currentPosition.u.LowPart+=cb;
/* /*
* Return the number of bytes read. * Cleanup
*/ */
*pcbWritten = cb; GlobalUnlock(This->supportHandle);
out:
/* /*
* Cleanup * Return the number of bytes read.
*/ */
GlobalUnlock(This->supportHandle); *pcbWritten = cb;
return S_OK; return S_OK;
} }
......
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