kernelbase: Use IOCTL_CONDRV_GET_TITLE in GetConsoleTitleW.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3576258402
commit
7444aa4230
|
@ -3589,7 +3589,9 @@ static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output)
|
||||||
|
|
||||||
static void test_FreeConsole(void)
|
static void test_FreeConsole(void)
|
||||||
{
|
{
|
||||||
|
WCHAR title[16];
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
|
DWORD size;
|
||||||
UINT cp;
|
UINT cp;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
|
@ -3637,6 +3639,13 @@ static void test_FreeConsole(void)
|
||||||
ok(!cp, "cp = %x\n", cp);
|
ok(!cp, "cp = %x\n", cp);
|
||||||
ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError());
|
||||||
|
|
||||||
|
SetLastError(0xdeadbeef);
|
||||||
|
memset( title, 0xc0, sizeof(title) );
|
||||||
|
size = GetConsoleTitleW( title, ARRAY_SIZE(title) );
|
||||||
|
ok(!size, "GetConsoleTitleW returned %u\n", size);
|
||||||
|
ok(title[0] == 0xc0c0, "title byffer changed\n");
|
||||||
|
ok(GetLastError() == ERROR_INVALID_HANDLE, "last error %u\n", GetLastError());
|
||||||
|
|
||||||
if (!skip_nt)
|
if (!skip_nt)
|
||||||
{
|
{
|
||||||
SetStdHandle( STD_INPUT_HANDLE, (HANDLE)0xdeadbeef );
|
SetStdHandle( STD_INPUT_HANDLE, (HANDLE)0xdeadbeef );
|
||||||
|
|
|
@ -739,20 +739,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleScreenBufferInfoEx( HANDLE handle,
|
||||||
*/
|
*/
|
||||||
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleTitleW( LPWSTR title, DWORD size )
|
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleTitleW( LPWSTR title, DWORD size )
|
||||||
{
|
{
|
||||||
DWORD ret = 0;
|
if (!size) return 0;
|
||||||
|
|
||||||
SERVER_START_REQ( get_console_input_info )
|
if (!console_ioctl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle, IOCTL_CONDRV_GET_TITLE,
|
||||||
{
|
NULL, 0, title, (size - 1) * sizeof(WCHAR), &size ))
|
||||||
req->handle = 0;
|
return 0;
|
||||||
wine_server_set_reply( req, title, (size - 1) * sizeof(WCHAR) );
|
|
||||||
if (!wine_server_call_err( req ))
|
size /= sizeof(WCHAR);
|
||||||
{
|
title[size] = 0;
|
||||||
ret = wine_server_reply_size(reply) / sizeof(WCHAR);
|
return size + 1;
|
||||||
title[ret] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SERVER_END_REQ;
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue