Commit 32eb41de authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernelbase: Use IOCTL_CONDRV_SET_INPUT_INFO in SetConsoleOutputCP.

parent c6e0cb6c
......@@ -3645,6 +3645,10 @@ static void test_FreeConsole(void)
ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleCP returned %x(%u)\n", ret, GetLastError());
SetLastError(0xdeadbeef);
ret = SetConsoleOutputCP(GetOEMCP());
ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleCP returned %x(%u)\n", ret, GetLastError());
SetLastError(0xdeadbeef);
memset( title, 0xc0, sizeof(title) );
size = GetConsoleTitleW( title, ARRAY_SIZE(title) );
ok(!size, "GetConsoleTitleW returned %u\n", size);
......
......@@ -1222,22 +1222,17 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode( HANDLE handle, DWORD mode )
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleOutputCP( UINT cp )
{
BOOL ret;
struct condrv_input_info_params params = { SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE };
if (!IsValidCodePage( cp ))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
SERVER_START_REQ( set_console_input_info )
{
req->handle = 0;
req->mask = SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE;
req->output_cp = cp;
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
return ret;
params.info.output_cp = cp;
return console_ioctl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle,
IOCTL_CONDRV_SET_INPUT_INFO, &params, sizeof(params), NULL, 0, NULL );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment