Sorry for the delayed review, I have been traveling.
I understand the issue your trying to fix, but I worry that you could get yourself into a bad state where if a driver is misbehaving and is blocked or crashes while processing an IRP then the halt event will never get processed as we will be waiting INFINITE on an event that may never come.
I dont know which is the more likely or problematic case.
What I may suggest is keep the WaitForMultipleObjects(2, events, FALSE, INFINITE) and instead of relying on the return code you could do an additional WaitForSingleObject(ext->halt_event, 0) to determine if exit_now should be set.
-aric
You are right, thank you. I have send a new patch now.
------------------ Regards, Changhui Liu
------------------ Original ------------------ From: "Aric Stewart"aric@codeweavers.com; Date: Mon, Dec 28, 2015 11:55 PM To: "wine-devel"wine-devel@winehq.org; "liuchanghui"liuchanghui@linuxdeepin.com;
Subject: Re: hidclass.sys: Properly quit hid_device_thread when bothcompletion event and halt event are signaled.
Sorry for the delayed review, I have been traveling.
I understand the issue your trying to fix, but I worry that you could get yourself into a bad state where if a driver is misbehaving and is blocked or crashes while processing an IRP then the halt event will never get processed as we will be waiting INFINITE on an event that may never come.
I dont know which is the more likely or problematic case.
What I may suggest is keep the WaitForMultipleObjects(2, events, FALSE, INFINITE) and instead of relying on the return code you could do an additional WaitForSingleObject(ext->halt_event, 0) to determine if exit_now should be set.
-aric