Author: jmorlan Date: Sun Jul 20 14:34:18 2008 New Revision: 34613
URL: http://svn.reactos.org/svn/reactos?rev=34613&view=rev Log: In ConioConsoleCtrlEvent, don't wait for the thread to terminate; a misbehaving handler could hang CSRSS indefinitely that way. Testing on Windows shows that no waiting is done when Ctrl-C is pressed; however, there is a wait of up to 5 seconds when attempting to close the window, so add a comment in GuiConsoleHandleClose mentioning this.
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win3... ============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Sun Jul 20 14:34:18 2008 @@ -79,7 +79,7 @@ VOID FASTCALL ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData) { - ConioConsoleCtrlEventTimeout(Event, ProcessData, INFINITE); + ConioConsoleCtrlEventTimeout(Event, ProcessData, 0); }
DWORD FASTCALL
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win3... ============================================================================== --- trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/csrss/win32csr/guiconsole.c [iso-8859-1] Sun Jul 20 14:34:18 2008 @@ -1241,6 +1241,9 @@ current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry); current_entry = current_entry->Flink;
+ /* FIXME: Windows will wait up to 5 seconds for the thread to exit. + * We shouldn't wait here, though, since the console lock is entered. + * A copy of the thread list probably needs to be made. */ ConioConsoleCtrlEvent(CTRL_CLOSE_EVENT, current); }