From: Francois Gouget fgouget@codeweavers.com
All the tests that follow would fail anyway, making it hard to filter them out to avoid false positives.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54558 --- Acquiring the device seems to randomly fail with a permission denied error, maybe when some other test triggers an UAC prompt. --- dlls/dinput/tests/device8.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/dinput/tests/device8.c b/dlls/dinput/tests/device8.c index 1f29c9af519..9db7d1149fb 100644 --- a/dlls/dinput/tests/device8.c +++ b/dlls/dinput/tests/device8.c @@ -344,7 +344,11 @@ void test_overlapped_format( DWORD version )
hr = IDirectInputDevice_Acquire( keyboard ); - ok( hr == DI_OK, "Acquire returned %#lx\n", hr ); + if (hr != DI_OK) + { + ok(0, "Acquire failed %#lx, skipping the remainder of test_overlapped_format\n", hr ); + return; + }
keybd_event( 0, DIK_F, KEYEVENTF_SCANCODE, 0 ); res = WaitForSingleObject( event, 100 ); @@ -405,7 +409,11 @@ void test_overlapped_format( DWORD version )
hr = IDirectInputDevice_Acquire( keyboard ); - ok( hr == DI_OK, "Acquire returned %#lx\n", hr ); + if (hr != DI_OK) + { + ok(0, "Acquire failed %#lx, skipping the remainder of test_overlapped_format\n", hr ); + return; + }
keybd_event( 0, DIK_F, KEYEVENTF_SCANCODE, 0 ); res = WaitForSingleObject( event, 100 ); @@ -1969,7 +1977,11 @@ static void test_sys_mouse( DWORD version ) hr = IDirectInputDevice8_Unacquire( device ); ok( hr == DI_NOEFFECT, "Unacquire returned %#lx\n", hr ); hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "Acquire returned %#lx\n", hr ); + if (hr != DI_OK) + { + ok(0, "Acquire failed %#lx, skipping the remainder of test_sys_mouse\n", hr ); + return; + } hr = IDirectInputDevice8_Acquire( device ); ok( hr == DI_NOEFFECT, "Acquire returned %#lx\n", hr );
@@ -1999,7 +2011,11 @@ static void test_sys_mouse( DWORD version ) ok( count == 1, "got count %lu\n", count );
hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "Acquire returned %#lx\n", hr ); + if (hr != DI_OK) + { + ok(0, "Acquire failed %#lx, skipping the remainder of test_sys_mouse\n", hr ); + return; + }
mouse_event( MOUSEEVENTF_MOVE, 10, 10, 0, 0 ); res = WaitForSingleObject( event, 100 ); @@ -2014,7 +2030,11 @@ static void test_sys_mouse( DWORD version ) ok( hr == DI_OK, "Unacquire returned %#lx\n", hr );
hr = IDirectInputDevice8_Acquire( device ); - ok( hr == DI_OK, "Acquire returned %#lx\n", hr ); + if (hr != DI_OK) + { + ok(0, "Acquire failed %#lx, skipping the remainder of test_sys_mouse\n", hr ); + return; + } count = 1; hr = IDirectInputDevice8_GetDeviceData( device, sizeof(objdata), &objdata, &count, 0 ); ok( hr == (version < 0x800 ? DI_OK : DI_BUFFEROVERFLOW), "GetDeviceData returned %#lx\n", hr );