Module: wine Branch: master Commit: 0a1da6bce93cb13db0a4fb3fed708caa88046ea1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0a1da6bce93cb13db0a4fb3fed...
Author: Sebastian Lackner sebastian@fds-team.de Date: Tue Sep 27 19:01:48 2016 +0200
user32: Call GlobalUnlock with the correct argument in SetClipboardData.
Signed-off-by: Sebastian Lackner sebastian@fds-team.de Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/user32/clipboard.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c index 9d80813..04d062d 100644 --- a/dlls/user32/clipboard.c +++ b/dlls/user32/clipboard.c @@ -868,7 +868,7 @@ HANDLE WINAPI SetClipboardData( UINT format, HANDLE data ) void *ptr = NULL; data_size_t size = 0; HANDLE handle = data, retval = 0; - BOOL ret; + NTSTATUS status = STATUS_SUCCESS;
TRACE( "%s %p\n", debugstr_format( format ), data );
@@ -888,14 +888,14 @@ HANDLE WINAPI SetClipboardData( UINT format, HANDLE data ) req->format = format; req->lcid = GetUserDefaultLCID(); wine_server_add_data( req, ptr, size ); - if ((ret = !wine_server_call_err( req ))) + if (!(status = wine_server_call( req ))) { if (cache) cache->seqno = reply->seqno; } } SERVER_END_REQ;
- if (ret) + if (!status) { /* free the previous entry if any */ struct cached_format *prev; @@ -909,8 +909,9 @@ HANDLE WINAPI SetClipboardData( UINT format, HANDLE data ) LeaveCriticalSection( &clipboard_cs );
done: - if (ptr) GlobalUnlock( ptr ); + if (ptr) GlobalUnlock( handle ); if (handle != data) GlobalFree( handle ); + if (status) SetLastError( RtlNtStatusToDosError( status )); return retval; }