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

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-08-13 16:01:37 +02:00 committed by Alexandre Julliard
parent ac94d88905
commit 0451e44d95
1 changed files with 1 additions and 3 deletions

View File

@ -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))