Rémi Bernon : dinput8/tests: Use WaitForSingleObject instead of GetOverlappedResultEx.

Alexandre Julliard julliard at winehq.org
Mon Nov 22 16:05:17 CST 2021


Module: wine
Branch: master
Commit: 1560f6df5f10c67bffef519cfbd9e7392baaec01
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1560f6df5f10c67bffef519cfbd9e7392baaec01

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Mon Nov 22 11:05:44 2021 +0100

dinput8/tests: Use WaitForSingleObject instead of GetOverlappedResultEx.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52075
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput8/tests/hid.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/dinput8/tests/hid.c b/dlls/dinput8/tests/hid.c
index cbb202530ac..f1342c5714d 100644
--- a/dlls/dinput8/tests/hid.c
+++ b/dlls/dinput8/tests/hid.c
@@ -745,16 +745,18 @@ static inline void check_hidp_value_caps_( int line, HIDP_VALUE_CAPS *caps, cons
 
 static BOOL sync_ioctl( HANDLE file, DWORD code, void *in_buf, DWORD in_len, void *out_buf, DWORD *ret_len, DWORD timeout )
 {
+    DWORD res, out_len = ret_len ? *ret_len : 0;
     OVERLAPPED ovl = {0};
-    DWORD out_len = ret_len ? *ret_len : 0;
     BOOL ret;
 
     ovl.hEvent = CreateEventW( NULL, TRUE, FALSE, NULL );
     ret = DeviceIoControl( file, code, in_buf, in_len, out_buf, out_len, &out_len, &ovl );
     if (!ret && GetLastError() == ERROR_IO_PENDING)
     {
-        ret = GetOverlappedResultEx( file, &ovl, &out_len, timeout, TRUE );
-        ok( ret, "GetOverlappedResultEx returned %u\n", GetLastError() );
+        res = WaitForSingleObject( ovl.hEvent, timeout );
+        ok( res == WAIT_OBJECT_0, "WaitForSingleObject returned %#x\n", res );
+        ret = GetOverlappedResult( file, &ovl, &out_len, FALSE );
+        ok( ret, "GetOverlappedResult returned %u\n", GetLastError() );
     }
     CloseHandle( ovl.hEvent );
 




More information about the wine-cvs mailing list