- HANDLE event;
-
- event = CreateEventW(NULL, FALSE, FALSE, NULL);
- hook_thread = CreateThread(NULL, 0, hook_thread_proc, &event, 0, &hook_thread_id);
- if (event && hook_thread)
- {
- HANDLE handles[2];
- handles[0] = event;
- handles[1] = hook_thread;
- WaitForMultipleObjects(2, handles, FALSE, INFINITE);
- }
+ hook_thread_event = CreateEventW(NULL, FALSE, FALSE, NULL);
+ hook_thread = CreateThread(NULL, 0, hook_thread_proc, hook_thread_event, 0, &hook_thread_id);