105 { |
105 { |
106 DWORD dwThreadId; |
106 DWORD dwThreadId; |
107 /* Create event to signal when console input is ready */ |
107 /* Create event to signal when console input is ready */ |
108 _hInputReady = CreateEvent(NULL, false, false, NULL); |
108 _hInputReady = CreateEvent(NULL, false, false, NULL); |
109 _hWaitForInputHandling = CreateEvent(NULL, false, false, NULL); |
109 _hWaitForInputHandling = CreateEvent(NULL, false, false, NULL); |
110 if (_hInputReady == NULL || _hWaitForInputHandling == NULL) error("Cannot create console event!"); |
110 if (_hInputReady == NULL || _hWaitForInputHandling == NULL) usererror("Cannot create console event!"); |
111 |
111 |
112 _hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CheckForConsoleInput, NULL, 0, &dwThreadId); |
112 _hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CheckForConsoleInput, NULL, 0, &dwThreadId); |
113 if (_hThread == NULL) error("Cannot create console thread!"); |
113 if (_hThread == NULL) usererror("Cannot create console thread!"); |
114 |
114 |
115 DEBUG(driver, 2, "Windows console thread started"); |
115 DEBUG(driver, 2, "Windows console thread started"); |
116 } |
116 } |
117 |
117 |
118 static void CloseWindowsConsoleThread() |
118 static void CloseWindowsConsoleThread() |