Commit 6cff6590 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernelbase: Use IOCTL_CONDRV_SET_TITLE in SetConsoleTitleW.

parent 32eb41de
......@@ -3656,6 +3656,10 @@ static void test_FreeConsole(void)
ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SetConsoleTitleW( L"test" );
ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "SetConsoleTitleW returned %x(%u)\n", ret, GetLastError());
SetLastError(0xdeadbeef);
hwnd = GetConsoleWindow();
ok(!hwnd, "hwnd = %p\n", hwnd);
ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError());
......
......@@ -1305,18 +1305,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleTextAttribute( HANDLE handle, WORD attr
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleTitleW( LPCWSTR title )
{
BOOL ret;
TRACE( "%s\n", debugstr_w( title ));
SERVER_START_REQ( set_console_input_info )
{
req->handle = 0;
req->mask = SET_CONSOLE_INPUT_INFO_TITLE;
wine_server_add_data( req, title, lstrlenW(title) * sizeof(WCHAR) );
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
return ret;
return console_ioctl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle, IOCTL_CONDRV_SET_TITLE,
(void *)title, lstrlenW(title) * sizeof(WCHAR), 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