X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fsubsys%2Fsystem%2Fcmd%2Fcmd.c;h=e62a014078a10d4082ccccbbeb19023a0e72055d;hp=ec3c065f788918c2d6d660f79acdb5485f8d6537;hb=593d6d0f28c2aa09f47fe7608beafea1b25da7cc;hpb=a0af76e470379d1eeea524629a963e1117590096 diff --git a/reactos/subsys/system/cmd/cmd.c b/reactos/subsys/system/cmd/cmd.c index ec3c065f788..e62a014078a 100644 --- a/reactos/subsys/system/cmd/cmd.c +++ b/reactos/subsys/system/cmd/cmd.c @@ -1449,7 +1449,7 @@ ProcessInput (BOOL bFlag) ConOutPuts (commandline); } - if (*commandline) + if (*commandline && !CheckCtrlBreak(BREAK_INPUT)) { ParseCommandLine (commandline); if (bEcho && !bIgnoreEcho && (!bIsBatch || bEchoThisLine)) @@ -1469,8 +1469,25 @@ ProcessInput (BOOL bFlag) BOOL WINAPI BreakHandler (DWORD dwCtrlType) { + DWORD dwWritten; + INPUT_RECORD rec; static BOOL SelfGenerated = FALSE; - + + rec.EventType = KEY_EVENT; + rec.Event.KeyEvent.bKeyDown = TRUE; + rec.Event.KeyEvent.wRepeatCount = 1; + rec.Event.KeyEvent.wVirtualKeyCode = _T('C'); + rec.Event.KeyEvent.wVirtualScanCode = _T('C') - 35; + rec.Event.KeyEvent.uChar.AsciiChar = _T('C'); + rec.Event.KeyEvent.uChar.UnicodeChar = _T('C'); + rec.Event.KeyEvent.dwControlKeyState = RIGHT_CTRL_PRESSED; + + WriteConsoleInput( + hIn, + &rec, + 1, + &dwWritten); + if ((dwCtrlType != CTRL_C_EVENT) && (dwCtrlType != CTRL_BREAK_EVENT)) {