Author: hbelusca
Date: Thu Nov 15 23:06:49 2012
New Revision: 57714
URL:
http://svn.reactos.org/svn/reactos?rev=57714&view=rev
Log:
[KERNEL32/CONSRV]
- Use a standard win32 thread function for the ConsoleControlDispatcher thread, instead of
a custom PCONTROLDISPATCHER one.
- Deactivate debug outputs in console.c, which were activated by error in r57706.
Modified:
branches/ros-csrss/dll/win32/kernel32/client/console/console.c
branches/ros-csrss/include/reactos/subsys/win/conmsg.h
Modified: branches/ros-csrss/dll/win32/kernel32/client/console/console.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/dll/win32/kernel32/cl…
==============================================================================
--- branches/ros-csrss/dll/win32/kernel32/client/console/console.c [iso-8859-1]
(original)
+++ branches/ros-csrss/dll/win32/kernel32/client/console/console.c [iso-8859-1] Thu Nov 15
23:06:49 2012
@@ -15,7 +15,7 @@
#include <k32.h>
-// #define NDEBUG
+#define NDEBUG
#include <debug.h>
extern RTL_CRITICAL_SECTION ConsoleLock;
@@ -66,16 +66,16 @@
return TRUE;
}
-__declspec(noreturn)
-VOID
-CALLBACK
-ConsoleControlDispatcher(DWORD CodeAndFlag)
+DWORD
+WINAPI
+ConsoleControlDispatcher(IN LPVOID lpThreadParameter)
{
DWORD nExitCode = 0;
+ DWORD CodeAndFlag = PtrToUlong(lpThreadParameter);
DWORD nCode = CodeAndFlag & MAXLONG;
UINT i;
EXCEPTION_RECORD erException;
-
+
DPRINT("Console Dispatcher Active: %lx %lx\n", CodeAndFlag, nCode);
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
@@ -92,7 +92,7 @@
erException.ExceptionRecord = NULL;
erException.ExceptionAddress = DefaultConsoleCtrlHandler;
erException.NumberParameters = 0;
-
+
_SEH2_TRY
{
RtlRaiseException(&erException);
@@ -100,7 +100,7 @@
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
RtlEnterCriticalSection(&ConsoleLock);
-
+
if ((nCode != CTRL_C_EVENT) ||
(NtCurrentPeb()->ProcessParameters->ConsoleFlags != 1))
{
@@ -109,14 +109,13 @@
if (CtrlHandlers[i - 1](nCode)) break;
}
}
-
+
RtlLeaveCriticalSection(&ConsoleLock);
}
_SEH2_END;
-
+
ExitThread(0);
}
-
break;
}
@@ -124,25 +123,22 @@
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
break;
-
+
case 3:
-
ExitThread(0);
break;
-
+
case 4:
-
ExitProcess(CONTROL_C_EXIT);
break;
default:
-
ASSERT(FALSE);
break;
}
-
+
ASSERT(ConsoleInitialized);
-
+
RtlEnterCriticalSection(&ConsoleLock);
nExitCode = 0;
if ((nCode != CTRL_C_EVENT) || (NtCurrentPeb()->ProcessParameters->ConsoleFlags
!= 1))
@@ -172,9 +168,10 @@
}
}
}
-
+
RtlLeaveCriticalSection(&ConsoleLock);
ExitThread(nExitCode);
+ return STATUS_SUCCESS;
}
Modified: branches/ros-csrss/include/reactos/subsys/win/conmsg.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/include/reactos/subsy…
==============================================================================
--- branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] (original)
+++ branches/ros-csrss/include/reactos/subsys/win/conmsg.h [iso-8859-1] Thu Nov 15
23:06:49 2012
@@ -153,12 +153,10 @@
DWORD ControlKeyState;
} CSRSS_READ_CONSOLE, *PCSRSS_READ_CONSOLE;
-typedef VOID (CALLBACK *PCONTROLDISPATCHER)(DWORD);
-
-typedef struct
-{
- PCONTROLDISPATCHER CtrlDispatcher;
- BOOLEAN ConsoleNeeded;
+typedef struct
+{
+ LPTHREAD_START_ROUTINE CtrlDispatcher;
+ BOOL ConsoleNeeded;
INT ShowCmd;
HANDLE Console;
HANDLE InputHandle;
@@ -308,7 +306,7 @@
HANDLE ConsoleHandle;
BOOL Unicode;
SMALL_RECT ScrollRectangle;
- BOOLEAN UseClipRectangle;
+ BOOL UseClipRectangle;
SMALL_RECT ClipRectangle;
COORD DestinationOrigin;
CHAR_INFO Fill;