Check for a valid console handle in SetConsoleMode.
Modified: trunk/reactos/lib/kernel32/misc/console.c
_____
Modified: trunk/reactos/lib/kernel32/misc/console.c
--- trunk/reactos/lib/kernel32/misc/console.c 2005-07-11 17:55:15 UTC
(rev 16534)
+++ trunk/reactos/lib/kernel32/misc/console.c 2005-07-11 18:22:53 UTC
(rev 16535)
@@ -2605,6 +2605,14 @@
NTSTATUS Status;
+ if (!IsConsoleHandle (hConsoleHandle))
+ {
+ DPRINT("SetConsoleMode was called with a non console handle\n");
+ SetLastError (ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+
CsrRequest = MAKE_CSR_API(SET_CONSOLE_MODE, CSR_CONSOLE);
Request.Data.SetConsoleModeRequest.ConsoleHandle = hConsoleHandle;
Request.Data.SetConsoleModeRequest.Mode = dwMode;