Wine test day #2: an easy lob

Piotr Caban piotr.caban at gmail.com
Thu Mar 6 12:38:27 CST 2014


I'm still trying to find what's happening there. It's related to some 
strange state that ddraw and dinput8 tests leaves mouse in.

What happens if dragdrop tests are executed just after dinput8 tests 
(and mouse is left above desktop):
  - dinput8 simulates mouse left button being pressed
  - this starts marquee selection on desktop (that is still in progress 
during dragdrop tests)
  - dragdrop is not receiving any mouse messages so it hangs (only 
desktop window is receiving mouse messages)
I've tried adding a temporary window that receives the click. This lets 
this tests run successfully.

Unfortunately it doesn't work when ddraw tests are also executed. If so 
dinput8 still causes mouse messages to be not delivered. It's somehow 
related to windows still doing some work related to recent mode changes. 
This case starts working if I add a 1 second sleep after ddraw tests. I 
don't know what really happens here.

I'm attaching a work in progress patch for dinput8 tests. I'm slowly out 
of ideas how to proceed further. If anyone has any thoughts please let 
me know.

Thanks,
Piotr
-------------- next part --------------
diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
index c66c43c..c526235 100644
--- a/dlls/dinput8/tests/device.c
+++ b/dlls/dinput8/tests/device.c
@@ -74,7 +74,7 @@ static void test_device_input(IDirectInputDevice8A *lpdid, DWORD event_type, DWO
         keybd_event( event, DIK_SPACE, 0, 0);
 
     if (event_type == INPUT_MOUSE)
-        mouse_event( event, 0, 0, 0, 0);
+        mouse_event( event, 50, 50, 0, 0);
 
     IDirectInputDevice8_Poll(lpdid);
     hr = IDirectInputDevice8_GetDeviceData(lpdid, sizeof(obj_data), &obj_data, &data_size, 0);
@@ -96,8 +96,8 @@ static void test_device_input(IDirectInputDevice8A *lpdid, DWORD event_type, DWO
         }
         else if (event_type == INPUT_MOUSE)
         {
-            mouse_event(MOUSEEVENTF_LEFTDOWN, 1, 1, 0, 0);
-            mouse_event(MOUSEEVENTF_LEFTUP, 1, 1, 0, 0);
+            mouse_event(MOUSEEVENTF_LEFTDOWN, 50, 50, 0, 0);
+            mouse_event(MOUSEEVENTF_LEFTUP, 50, 50, 0, 0);
         }
 
     IDirectInputDevice8_Poll(lpdid);
@@ -108,6 +108,9 @@ static void test_device_input(IDirectInputDevice8A *lpdid, DWORD event_type, DWO
     data_size = 1;
     hr = IDirectInputDevice8_GetDeviceData(lpdid, sizeof(obj_data), &obj_data, &data_size, 0);
     ok(hr == DI_OK && data_size == 1, "GetDeviceData() failed: %08x cnt:%d\n", hr, data_size);
+
+    hr = IDirectInputDevice8_Unacquire(lpdid);
+    ok( SUCCEEDED(hr), "Failed to unacquire device hr=%08x\n", hr);
 }
 
 static void test_build_action_map(IDirectInputDevice8A *lpdid, DIACTIONFORMATA *lpdiaf,
@@ -320,11 +323,17 @@ static void test_action_mapping(void)
 
     if (data.mouse != NULL)
     {
+        HWND hwnd = CreateWindowA("static", "dinput", WS_POPUP | WS_VISIBLE, 0, 0, 100, 100, NULL, NULL, NULL, NULL);
+        ok(hwnd != NULL, "failed to create window\n");
+        SetCursorPos(50, 50);
+
         /* Test mouse BuildActionMap */
         test_build_action_map(data.mouse, data.lpdiaf, DITEST_MOUSEBUTTON0, DIDFT_PSHBUTTON, 0x03);
         test_build_action_map(data.mouse, data.lpdiaf, DITEST_YAXIS, DIDFT_RELAXIS, 0x01);
 
         test_device_input(data.mouse, INPUT_MOUSE, MOUSEEVENTF_LEFTDOWN, 3);
+
+        DestroyWindow(hwnd);
     }
 }
 


More information about the wine-devel mailing list