Shouldn't it have only the
return STATUS_UNSUCCESSFUL;
changed to
return STATUS_INVALID_PARAMETER;
in the original version? I doubt IsValidCodePage should return true
for a 0 codepage.
WBR,
Aleksey Bragin.
On Apr 13, 2009, at 4:33 PM, dchapyshev(a)svn.reactos.org wrote:
Author: dchapyshev
Date: Mon Apr 13 16:33:33 2009
New Revision: 40480
URL:
http://svn.reactos.org/svn/reactos?rev=40480&view=rev
Log:
- Add more check on CodePage = 0. +2 passed wine tests
Modified:
trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/
win32/csrss/win32csr/conio.c?rev=40480&r1=40479&r2=40480&view=diff
======================================================================
========
--- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
[iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
[iso-8859-1] Mon Apr 13 16:33:33 2009
@@ -3023,12 +3023,20 @@
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.SetConsoleOutputCodePage.CodePage))
+
if (Request->Data.SetConsoleOutputCodePage.CodePage == 0)
+ {
+ ConioUnlockConsole(Console);
+ return STATUS_INVALID_PARAMETER;
+ }
+ else
+ {
+ if (IsValidCodePage(Request-
Data.SetConsoleOutputCodePage.CodePage))
{
Console->OutputCodePage = Request-
Data.SetConsoleOutputCodePage.CodePage;
ConioUnlockConsole(Console);
return STATUS_SUCCESS;
}
+ }
ConioUnlockConsole(Console);
return STATUS_UNSUCCESSFUL;
}