Alexandre Julliard : winex11: Don't disallow replacing unowned formats.
Alexandre Julliard
julliard at winehq.org
Tue Aug 23 11:28:44 CDT 2016
Module: wine
Branch: master
Commit: 99d5b75c7d943270e93c5362ba1ecce0d99e20ed
URL: http://source.winehq.org/git/wine.git/?a=commit;h=99d5b75c7d943270e93c5362ba1ecce0d99e20ed
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Aug 23 17:59:36 2016 +0900
winex11: Don't disallow replacing unowned formats.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/tests/clipboard.c | 1 -
dlls/winex11.drv/clipboard.c | 21 ++-------------------
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c
index ddd8d1a..549a625 100644
--- a/dlls/user32/tests/clipboard.c
+++ b/dlls/user32/tests/clipboard.c
@@ -93,7 +93,6 @@ static void set_clipboard_data_process( int arg )
todo_wine_if( arg == 1 || arg == 3 )
ok( IsClipboardFormatAvailable( CF_WAVE ), "process %u: CF_WAVE not available\n", arg );
ret = SetClipboardData( CF_WAVE, GlobalAlloc( GMEM_DDESHARE | GMEM_ZEROINIT, 100 ));
- todo_wine_if( arg == 2 || arg == 4 )
ok( ret != 0, "process %u: SetClipboardData failed err %u\n", arg, GetLastError() );
}
else
diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index b7c89cb..af8fa37 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -3013,26 +3013,9 @@ void CDECL X11DRV_EmptyClipboard(void)
*/
BOOL CDECL X11DRV_SetClipboardData(UINT wFormat, HANDLE hData, BOOL owner)
{
- DWORD flags = 0;
- BOOL bResult = TRUE;
+ if (!owner) X11DRV_CLIPBOARD_UpdateCache();
- /* If it's not owned, data can only be set if the format data is not already owned */
- if (!owner)
- {
- LPWINE_CLIPDATA lpRender;
-
- X11DRV_CLIPBOARD_UpdateCache();
-
- if (((lpRender = X11DRV_CLIPBOARD_LookupData(wFormat)) &&
- !(lpRender->wFlags & CF_FLAG_UNOWNED)))
- bResult = FALSE;
- else
- flags = CF_FLAG_UNOWNED;
- }
-
- bResult &= X11DRV_CLIPBOARD_InsertClipboardData(wFormat, hData, flags, NULL, TRUE);
-
- return bResult;
+ return X11DRV_CLIPBOARD_InsertClipboardData(wFormat, hData, 0, NULL, TRUE);
}
More information about the wine-cvs
mailing list