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

This commit is contained in:
Alexandre Julliard 2015-06-03 18:39:18 +09:00
parent e99c3f0c4b
commit bdf3f413af
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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;