From 9d1684bf68ca039a771fbdd08c7ee79f3c377e0c Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Mon, 13 Apr 2009 12:26:28 +0000 Subject: [PATCH] - Add check on CodePage = 0. +2 passed wine tests svn path=/trunk/; revision=40479 --- reactos/subsystems/win32/csrss/win32csr/conio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/csrss/win32csr/conio.c b/reactos/subsystems/win32/csrss/win32csr/conio.c index b4e88c7df3d..78e3726c758 100644 --- a/reactos/subsystems/win32/csrss/win32csr/conio.c +++ b/reactos/subsystems/win32/csrss/win32csr/conio.c @@ -2970,12 +2970,20 @@ CSR_API(CsrSetConsoleCodePage) Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); - if (IsValidCodePage(Request->Data.SetConsoleCodePage.CodePage)) + if (Request->Data.SetConsoleCodePage.CodePage == 0) + { + ConioUnlockConsole(Console); + return STATUS_INVALID_PARAMETER; + } + else + { + if (IsValidCodePage(Request->Data.SetConsoleCodePage.CodePage)) { Console->CodePage = Request->Data.SetConsoleCodePage.CodePage; ConioUnlockConsole(Console); return STATUS_SUCCESS; } + } ConioUnlockConsole(Console); return STATUS_UNSUCCESSFUL; }