|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XENHID PATCH] thread: Wait for the thread if ObReferenceObjectByHandle fails
If ObReferenceObjectByHandle fails, the thread would have already
started. We need to wait for it to exit before cleaning up.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xenhid/thread.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/xenhid/thread.c b/src/xenhid/thread.c
index 954e060..24ffbce 100644
--- a/src/xenhid/thread.c
+++ b/src/xenhid/thread.c
@@ -30,6 +30,7 @@
* SUCH DAMAGE.
*/
+#include <ntifs.h>
#include <ntddk.h>
#include "thread.h"
@@ -171,6 +172,7 @@ fail3:
Error("fail3\n");
__ThreadAlert(*Thread);
+ ZwWaitForSingleObject(Handle, FALSE, NULL);
ZwClose(Handle);
fail2:
--
2.56.0.windows.4
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |