Module: wine
Branch: master
Commit: e08eb410ee2f596b57bee64bfa1f55287092f630
URL: https://source.winehq.org/git/wine.git/?a=commit;h=e08eb410ee2f596b57bee64b…
Author: Micah N Gorrell <mgorrell(a)codeweavers.com>
Date: Thu Nov 7 14:38:24 2019 -0700
ole32: Obtain stream size regardless of current position.
Use STREAM_SEEK_END when attempting to determine the size of a stream
that clipboard data has just been rendered into. This corrects an issue
with Office 2016 where the current position of the stream is 0 while
rendering a target of image/png.
Signed-off-by: Micah N Gorrell <mgorrell(a)codeweavers.com>
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/ole32/clipboard.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c
index 0c02d02a65..9df37750a3 100644
--- a/dlls/ole32/clipboard.c
+++ b/dlls/ole32/clipboard.c
@@ -788,7 +788,7 @@ static HRESULT get_data_from_stream(IDataObject *data, FORMATETC *fmt, HGLOBAL *
if(FAILED(hr)) goto error;
offs.QuadPart = 0;
- IStream_Seek(med.u.pstm, offs, STREAM_SEEK_CUR, &pos);
+ IStream_Seek(med.u.pstm, offs, STREAM_SEEK_END, &pos);
IStream_Seek(med.u.pstm, offs, STREAM_SEEK_SET, NULL);
hr = IStream_CopyTo(med.u.pstm, stm, pos, NULL, NULL);
ReleaseStgMedium(&med);