Commit 0451e44d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernel32: Use PEB console handle in CONSOLE_HandleCtrlC to check console connection.

parent ac94d889
...@@ -659,9 +659,7 @@ LONG CALLBACK CONSOLE_HandleCtrlC( EXCEPTION_POINTERS *eptr ) ...@@ -659,9 +659,7 @@ LONG CALLBACK CONSOLE_HandleCtrlC( EXCEPTION_POINTERS *eptr )
HANDLE thread; HANDLE thread;
if (eptr->ExceptionRecord->ExceptionCode != CONTROL_C_EXIT) return EXCEPTION_CONTINUE_SEARCH; if (eptr->ExceptionRecord->ExceptionCode != CONTROL_C_EXIT) return EXCEPTION_CONTINUE_SEARCH;
if (!RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle) return EXCEPTION_CONTINUE_SEARCH;
/* FIXME: better test whether a console is attached to this process ??? */
if (CONSOLE_GetNumHistoryEntries() == (unsigned)-1) return EXCEPTION_CONTINUE_SEARCH;
/* check if we have to ignore ctrl-C events */ /* check if we have to ignore ctrl-C events */
if (!(NtCurrentTeb()->Peb->ProcessParameters->ConsoleFlags & 1)) if (!(NtCurrentTeb()->Peb->ProcessParameters->ConsoleFlags & 1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment