mirror of
https://github.com/reactos/wine.git
synced 2024-11-23 20:00:00 +00:00
hidclass.sys: Properly quit hid_device_thread when both completion event and halt event are signaled.
Signed-off-by: Changhui Liu <liuchanghui@linuxdeepin.com> Signed-off-by: Aric Stewart <aric@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a443318d18
commit
3f2055b1cf
@ -261,7 +261,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
|
||||
NTSTATUS ntrc;
|
||||
|
||||
BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
|
||||
events[0] = CreateEventA(NULL, FALSE, FALSE, NULL);
|
||||
events[0] = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||
events[1] = ext->halt_event;
|
||||
|
||||
if (ext->information.Polled)
|
||||
@ -336,12 +336,13 @@ static DWORD CALLBACK hid_device_thread(void *args)
|
||||
|
||||
if (ntrc == STATUS_PENDING)
|
||||
{
|
||||
rc = WaitForMultipleObjects(2, events, FALSE, INFINITE);
|
||||
|
||||
if (rc == WAIT_OBJECT_0 + 1)
|
||||
exit_now = TRUE;
|
||||
WaitForMultipleObjects(2, events, FALSE, INFINITE);
|
||||
}
|
||||
|
||||
rc = WaitForSingleObject(ext->halt_event, 0);
|
||||
if (rc == WAIT_OBJECT_0)
|
||||
exit_now = TRUE;
|
||||
|
||||
if (!exit_now && irp->IoStatus.u.Status == STATUS_SUCCESS)
|
||||
{
|
||||
packet->reportId = buffer[0];
|
||||
@ -368,7 +369,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
|
||||
void HID_StartDeviceThread(DEVICE_OBJECT *device)
|
||||
{
|
||||
BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
|
||||
ext->halt_event = CreateEventA(NULL, FALSE, FALSE, NULL);
|
||||
ext->halt_event = CreateEventA(NULL, TRUE, FALSE, NULL);
|
||||
ext->thread = CreateThread(NULL, 0, hid_device_thread, device, 0, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user