Global (Windows): prefers NtWaitForSingleObject

This commit is contained in:
李通洲
2026-03-14 23:08:25 +08:00
parent f46e97fc62
commit 81984e6e97
4 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -3,7 +3,6 @@
#include "common/mallocHelper.h"
#include "common/windows/unicode.h"
#include <winternl.h>
#include <windows.h>
#include <hidsdi.h>
@@ -159,7 +158,7 @@ const char* ffDetectGamepad(FFlist* devices /* List of FFGamepadDevice */)
OVERLAPPED overlapped = { };
DWORD nBytes;
if (ReadFile(hHidFile, reportBuffer, caps.InputReportByteLength, &nBytes, &overlapped) ||
(WaitForSingleObject(hHidFile, FF_IO_TERM_RESP_WAIT_MS) == WAIT_OBJECT_0 && GetOverlappedResult(hHidFile, &overlapped, &nBytes, FALSE)))
GetOverlappedResultEx(hHidFile, &overlapped, &nBytes, FF_IO_TERM_RESP_WAIT_MS, TRUE))
{
if (rdi.hid.dwVendorId == 0x054C)
{