mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
xinput1_3: Wait for CancelIoEx completion when disabling controllers.
Otherwise we may later write the cancelled status to invalid memory. Also use a manual-reset event, as it should be for overlapped I/O, so all waiters are waken up on cancel. Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5d022fd0dc
commit
54db761040
1 changed files with 2 additions and 1 deletions
|
@ -354,6 +354,7 @@ static void controller_disable(struct xinput_controller *controller)
|
|||
controller->enabled = FALSE;
|
||||
|
||||
CancelIoEx(controller->device, &controller->hid.read_ovl);
|
||||
WaitForSingleObject(controller->hid.read_ovl.hEvent, INFINITE);
|
||||
SetEvent(update_event);
|
||||
}
|
||||
|
||||
|
@ -365,7 +366,7 @@ static BOOL controller_init(struct xinput_controller *controller, PHIDP_PREPARSE
|
|||
controller->hid.caps = *caps;
|
||||
if (!(controller->hid.feature_report_buf = calloc(1, controller->hid.caps.FeatureReportByteLength))) goto failed;
|
||||
if (!controller_check_caps(controller, device, preparsed)) goto failed;
|
||||
if (!(event = CreateEventA(NULL, FALSE, FALSE, NULL))) goto failed;
|
||||
if (!(event = CreateEventW(NULL, TRUE, FALSE, NULL))) goto failed;
|
||||
|
||||
TRACE("Found gamepad %s\n", debugstr_w(device_path));
|
||||
|
||||
|
|
Loading…
Reference in a new issue