Module: wine Branch: master Commit: 8dc5bd8e2979323a3146b986f1657d6447a4e732 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=8dc5bd8e2979323a3146b986...
Author: Mike McCormack mike@codeweavers.com Date: Mon Aug 14 14:06:53 2006 +0900
ole32: Always set pcbWritten when writing a stream.
---
dlls/ole32/hglobalstream.c | 24 ++++++++++-------------- 1 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c index 1ae7247..eb2af30 100644 --- a/dlls/ole32/hglobalstream.c +++ b/dlls/ole32/hglobalstream.c @@ -287,8 +287,7 @@ static HRESULT WINAPI HGLOBALStreamImpl_ ULARGE_INTEGER newSize; ULONG bytesWritten = 0;
- TRACE("(%p, %p, %ld, %p)\n", iface, - pv, cb, pcbWritten); + TRACE("(%p, %p, %ld, %p)\n", iface, pv, cb, pcbWritten);
/* * If the caller is not interested in the number of bytes written, @@ -298,14 +297,10 @@ static HRESULT WINAPI HGLOBALStreamImpl_ pcbWritten = &bytesWritten;
if (cb == 0) - { - return S_OK; - } - else - { - newSize.u.HighPart = 0; - newSize.u.LowPart = This->currentPosition.u.LowPart + cb; - } + goto out; + + newSize.u.HighPart = 0; + newSize.u.LowPart = This->currentPosition.u.LowPart + cb;
/* * Verify if we need to grow the stream @@ -334,14 +329,15 @@ static HRESULT WINAPI HGLOBALStreamImpl_ 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; }