Commit in reactos on MAIN
subsys/csrss/win32csr/conio.c+6-61.14 -> 1.15
                     /guiconsole.c+2-151.19 -> 1.20
subsys/csrss/include/conio.h+2-11.4 -> 1.5
lib/kernel32/misc/console.c+2-41.79 -> 1.80
+12-26
4 modified files
Send CTRL_CLOSE_EVENT to processes attached to a console when that console
is closed. Default handle the event by terminating the process.

reactos/subsys/csrss/win32csr
conio.c 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- conio.c	25 Aug 2004 10:37:14 -0000	1.14
+++ conio.c	10 Sep 2004 22:14:52 -0000	1.15
@@ -1,4 +1,4 @@
-/* $Id: conio.c,v 1.14 2004/08/25 10:37:14 hbirr Exp $
+/* $Id: conio.c,v 1.15 2004/09/10 22:14:52 gvg Exp $
  *
  * reactos/subsys/csrss/win32csr/conio.c
  *
@@ -63,12 +63,12 @@
   return STATUS_SUCCESS;
 }
 
-STATIC VOID FASTCALL
-CsrConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
+VOID FASTCALL
+ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData)
 {
   HANDLE Process, Thread;
 	
-  DPRINT("CsrConsoleCtrlEvent Parent ProcessId = %x\n",	ProcessData->ProcessId);
+  DPRINT("ConioConsoleCtrlEvent Parent ProcessId = %x\n",	ProcessData->ProcessId);
 
   if (ProcessData->CtrlDispatcher)
     {
@@ -79,7 +79,7 @@
           return;
         }
 
-      DPRINT("CsrConsoleCtrlEvent Process Handle = %x\n", Process);
+      DPRINT("ConioConsoleCtrlEvent Process Handle = %x\n", Process);
 
       Thread = CreateRemoteThread(Process, NULL, 0,
                                   (LPTHREAD_START_ROUTINE) ProcessData->CtrlDispatcher,
@@ -988,7 +988,7 @@
 	{
 	  current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry);
 	  current_entry = current_entry->Flink;
-	  CsrConsoleCtrlEvent((DWORD)CTRL_C_EVENT, current);
+	  ConioConsoleCtrlEvent((DWORD)CTRL_C_EVENT, current);
 	}
       HeapFree(Win32CsrApiHeap, 0, KeyEventRecord);
       return;

reactos/subsys/csrss/win32csr
guiconsole.c 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- guiconsole.c	24 Aug 2004 17:25:17 -0000	1.19
+++ guiconsole.c	10 Sep 2004 22:14:52 -0000	1.20
@@ -1,4 +1,4 @@
-/* $Id: guiconsole.c,v 1.19 2004/08/24 17:25:17 navaraf Exp $
+/* $Id: guiconsole.c,v 1.20 2004/09/10 22:14:52 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -571,8 +571,6 @@
   PGUI_CONSOLE_DATA GuiData;
   PLIST_ENTRY current_entry;
   PCSRSS_PROCESS_DATA current;
-  HANDLE Process;
-  BOOL Result;
 
   GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
 
@@ -584,18 +582,7 @@
       current = CONTAINING_RECORD(current_entry, CSRSS_PROCESS_DATA, ProcessEntry);
       current_entry = current_entry->Flink;
 
-      Process = OpenProcess(PROCESS_DUP_HANDLE, FALSE, current->ProcessId);
-      if (NULL == Process)
-        {
-          DPRINT1("Failed for handle duplication\n");
-	  continue;
-        }
-      Result = TerminateProcess(Process, 0);
-      CloseHandle(Process);
-      if (!Result)
-        {
-	  DPRINT1("Failed to terminate process %d\n", current->ProcessId);
-	}
+      ConioConsoleCtrlEvent(CTRL_CLOSE_EVENT, current);
     }
 
   LeaveCriticalSection(&Console->Header.Lock);

reactos/subsys/csrss/include
conio.h 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- conio.h	22 Aug 2004 20:52:28 -0000	1.4
+++ conio.h	10 Sep 2004 22:14:52 -0000	1.5
@@ -1,4 +1,4 @@
-/* $Id: conio.h,v 1.4 2004/08/22 20:52:28 navaraf Exp $
+/* $Id: conio.h,v 1.5 2004/09/10 22:14:52 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -99,6 +99,7 @@
                                      LONG *LogicalX,
                                      LONG *LogicalY);
 VOID FASTCALL ConioDrawConsole(PCSRSS_CONSOLE Console);
+VOID FASTCALL ConioConsoleCtrlEvent(DWORD Event, PCSRSS_PROCESS_DATA ProcessData);
 
 /* api/conio.c */
 CSR_API(CsrWriteConsole);

reactos/lib/kernel32/misc
console.c 1.79 -> 1.80
diff -u -r1.79 -r1.80
--- console.c	28 Aug 2004 22:14:08 -0000	1.79
+++ console.c	10 Sep 2004 22:14:52 -0000	1.80
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.79 2004/08/28 22:14:08 navaraf Exp $
+/* $Id: console.c,v 1.80 2004/09/10 22:14:52 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -41,12 +41,10 @@
 	{
 	case CTRL_C_EVENT:
 		DPRINT("Ctrl-C Event\n");
-		ExitProcess(0);
 		break;
 		
 	case CTRL_BREAK_EVENT:
 		DPRINT("Ctrl-Break Event\n");
-		ExitProcess(0);
 		break;
 
 	case CTRL_SHUTDOWN_EVENT:
@@ -61,7 +59,7 @@
 		DPRINT("Ctrl Logoff Event\n");
 		break;
 	}
-//	ExitProcess((UINT)&ExitCode);
+	ExitProcess(0);
 	return TRUE;
 }
 
CVSspam 0.2.8