[PATCH 2/2] dinput/tests: Remove racy IForceFeedbackEffect reference count checks.

Rémi Bernon wine at gitlab.winehq.org
Thu Jul 7 01:56:07 CDT 2022


From: Rémi Bernon <rbernon at codeweavers.com>

Because the async operation holds a reference on the invoker and the
param, it may keep the effect alive until the worker thread releases
its reference on the async operation. We have no way to synchronize on
that.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53199
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/dinput/tests/force_feedback.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/dlls/dinput/tests/force_feedback.c b/dlls/dinput/tests/force_feedback.c
index 1bcd56d685a..8fb15e38f13 100644
--- a/dlls/dinput/tests/force_feedback.c
+++ b/dlls/dinput/tests/force_feedback.c
@@ -5673,7 +5673,6 @@ static void test_windows_gaming_input(void)
     UINT32 size;
     HRESULT hr;
     DWORD ret;
-    LONG ref;
 
     if (!load_combase_functions()) return;
 
@@ -6053,8 +6052,7 @@ static void test_windows_gaming_input(void)
     todo_wine
     ok( hr == 0x86854003, "TryUnloadEffectAsync returned %#lx\n", hr );
 
-    ref = IForceFeedbackEffect_Release( effect );
-    ok( ref == 0, "Release returned %lu\n", ref );
+    IForceFeedbackEffect_Release( effect );
 
 
     hr = IPeriodicForceEffectFactory_CreateInstance( periodic_factory, PeriodicForceEffectKind_SineWave, &effect );
@@ -6127,8 +6125,7 @@ static void test_windows_gaming_input(void)
     IAsyncOperation_boolean_Release( bool_async );
     set_hid_expect( file, NULL, 0 );
 
-    ref = IForceFeedbackEffect_Release( effect );
-    ok( ref == 0, "Release returned %lu\n", ref );
+    IForceFeedbackEffect_Release( effect );
 
     IPeriodicForceEffectFactory_Release( periodic_factory );
 
@@ -6220,8 +6217,7 @@ static void test_windows_gaming_input(void)
     IAsyncOperation_boolean_Release( bool_async );
     set_hid_expect( file, NULL, 0 );
 
-    ref = IForceFeedbackEffect_Release( effect );
-    ok( ref == 0, "Release returned %lu\n", ref );
+    IForceFeedbackEffect_Release( effect );
 
     IConditionForceEffectFactory_Release( condition_factory );
 
@@ -6313,8 +6309,7 @@ static void test_windows_gaming_input(void)
     IAsyncOperation_boolean_Release( bool_async );
     set_hid_expect( file, NULL, 0 );
 
-    ref = IForceFeedbackEffect_Release( effect );
-    ok( ref == 0, "Release returned %lu\n", ref );
+    IForceFeedbackEffect_Release( effect );
 
 
     hr = pWindowsCreateString( ramp_effect_class_name, wcslen( ramp_effect_class_name ), &str );
@@ -6387,8 +6382,7 @@ static void test_windows_gaming_input(void)
     IAsyncOperation_boolean_Release( bool_async );
     set_hid_expect( file, NULL, 0 );
 
-    ref = IForceFeedbackEffect_Release( effect );
-    ok( ref == 0, "Release returned %lu\n", ref );
+    IForceFeedbackEffect_Release( effect );
 
 
     IForceFeedbackMotor_Release( motor );
-- 
GitLab

https://gitlab.winehq.org/wine/wine/-/merge_requests/396



More information about the wine-devel mailing list