CORE-11677
The standard Win32 Console Control Handler will give CTRL-C events to
processes spawned from cmd.exe. If cmd.exe calls GenerateConsolCtrlEvent()
then the child process will receive two CTRL-C events.
NULL,
NULL,
TRUE,
- 0, /* CREATE_NEW_PROCESS_GROUP */
+ 0,
NULL,
NULL,
&stui,
{
DWORD dwWritten;
INPUT_RECORD rec;
- static BOOL SelfGenerated = FALSE;
if ((dwCtrlType != CTRL_C_EVENT) &&
(dwCtrlType != CTRL_BREAK_EVENT))
{
return FALSE;
}
- else
- {
- if (SelfGenerated)
- {
- SelfGenerated = FALSE;
- return TRUE;
- }
- }
if (!TryEnterCriticalSection(&ChildProcessRunningLock))
{
- SelfGenerated = TRUE;
- GenerateConsoleCtrlEvent (dwCtrlType, 0);
+ /* Child process is running and will have received the control event */
return TRUE;
}
else