The cursor is changed in give_feedback() but is not restored back.
-- v2: ole32: Preserve cursor in DoDragDrop. ole32/tests: Test that cursor is preserved in DoDragDrop.
From: Roman Pišl rpisl@seznam.cz
--- dlls/ole32/tests/dragdrop.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/ole32/tests/dragdrop.c b/dlls/ole32/tests/dragdrop.c index bd63c11401f..1cb806ae031 100644 --- a/dlls/ole32/tests/dragdrop.c +++ b/dlls/ole32/tests/dragdrop.c @@ -686,6 +686,7 @@ static void test_Register_Revoke(void)
static void test_DoDragDrop(void) { + HCURSOR cursor; DWORD effect; HRESULT hr; HWND hwnd; @@ -729,6 +730,8 @@ static void test_DoDragDrop(void) GetWindowRect(hwnd, &rect); ok(SetCursorPos(rect.left+50, rect.top+50), "SetCursorPos failed\n");
+ cursor = GetCursor(); + for (test_reentrance = 0; test_reentrance < 2; test_reentrance++) { for (seq = 0; seq < ARRAY_SIZE(call_lists); seq++) @@ -745,6 +748,9 @@ static void test_DoDragDrop(void) } }
+ todo_wine + ok(GetCursor() == cursor, "cursor not restored\n"); + OleUninitialize();
DestroyWindow(hwnd);
From: Roman Pišl rpisl@seznam.cz
--- dlls/ole32/ole2.c | 7 +++++++ dlls/ole32/tests/dragdrop.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index f4672b704ee..b37b5b0e387 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -733,6 +733,7 @@ HRESULT WINAPI DoDragDrop ( TrackerWindowInfo trackerInfo; HWND hwndTrackWindow; MSG msg; + HCURSOR cursor;
TRACE("%p, %p, %#lx, %p.\n", pDataObject, pDropSource, dwOKEffect, pdwEffect);
@@ -767,6 +768,9 @@ HRESULT WINAPI DoDragDrop (
msg.message = 0;
+ /* save cursor */ + cursor = GetCursor(); + /* * Pump messages. All mouse input should go to the capture window. */ @@ -813,6 +817,9 @@ HRESULT WINAPI DoDragDrop ( */ DestroyWindow(hwndTrackWindow);
+ /* restore cursor */ + SetCursor(cursor); + return trackerInfo.returnValue; }
diff --git a/dlls/ole32/tests/dragdrop.c b/dlls/ole32/tests/dragdrop.c index 1cb806ae031..ab085c48ffb 100644 --- a/dlls/ole32/tests/dragdrop.c +++ b/dlls/ole32/tests/dragdrop.c @@ -748,7 +748,6 @@ static void test_DoDragDrop(void) } }
- todo_wine ok(GetCursor() == cursor, "cursor not restored\n");
OleUninitialize();