Alexandre Julliard : server: Allow opening the clipboard again with the same owner.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jun 3 09:43:08 CDT 2015


Module: wine
Branch: master
Commit: bdf3f413afc2efae68b7545083d6eb0893cd2687
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bdf3f413afc2efae68b7545083d6eb0893cd2687

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jun  3 18:39:18 2015 +0900

server: Allow opening the clipboard again with the same owner.

---

 dlls/user32/tests/clipboard.c | 3 ++-
 server/clipboard.c            | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c
index f12e0cd..a9aef84 100644
--- a/dlls/user32/tests/clipboard.c
+++ b/dlls/user32/tests/clipboard.c
@@ -51,11 +51,12 @@ static void test_ClipboardOwner(void)
     ok(OpenClipboard(0), "OpenClipboard failed\n");
     ok(!GetClipboardOwner(), "clipboard should still be not owned\n");
     ok(!OpenClipboard(hWnd1), "OpenClipboard should fail since clipboard already opened\n");
+    ok(OpenClipboard(0), "OpenClipboard again failed\n");
     ret = CloseClipboard();
     ok( ret, "CloseClipboard error %d\n", GetLastError());
 
     ok(OpenClipboard(hWnd1), "OpenClipboard failed\n");
-    todo_wine ok(OpenClipboard(hWnd1), "OpenClipboard second time in the same hwnd failed\n");
+    ok(OpenClipboard(hWnd1), "OpenClipboard second time in the same hwnd failed\n");
 
     SetLastError(0xdeadbeef);
     ret = OpenClipboard(hWnd2);
diff --git a/server/clipboard.c b/server/clipboard.c
index f144ea1..7a77ed2 100644
--- a/server/clipboard.c
+++ b/server/clipboard.c
@@ -138,7 +138,7 @@ void cleanup_clipboard_thread(struct thread *thread)
 static int open_clipboard( struct clipboard *clipboard, user_handle_t win )
 {
     win = get_user_full_handle( win );
-    if (clipboard->open_thread && clipboard->open_thread != current)
+    if (clipboard->open_thread && (clipboard->open_thread != current || clipboard->open_win != win))
     {
         set_error(STATUS_WAS_LOCKED);
         return 0;




More information about the wine-cvs mailing list