mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 12:33:41 +00:00
kernelbase: Implement GetConsoleOriginalTitleA().
This commit is contained in:
parent
887aa70e08
commit
30f1c1be74
|
@ -4238,17 +4238,17 @@ static void test_GetConsoleOriginalTitleA(void)
|
|||
ok(!ret, "Unexpected string length; error %lu\n", GetLastError());
|
||||
|
||||
ret = GetConsoleOriginalTitleA(buf, ARRAY_SIZE(buf));
|
||||
todo_wine ok(ret, "GetConsoleOriginalTitleA failed: %lu\n", GetLastError());
|
||||
todo_wine ok(!strcmp(buf, title), "got %s, expected %s\n", wine_dbgstr_a(buf), wine_dbgstr_a(title));
|
||||
todo_wine ok(ret == title_len, "got %lu, expected %lu\n", ret, title_len);
|
||||
ok(ret, "GetConsoleOriginalTitleA failed: %lu\n", GetLastError());
|
||||
ok(!strcmp(buf, title), "got %s, expected %s\n", wine_dbgstr_a(buf), wine_dbgstr_a(title));
|
||||
ok(ret == title_len, "got %lu, expected %lu\n", ret, title_len);
|
||||
|
||||
ret = SetConsoleTitleA("test");
|
||||
ok(ret, "SetConsoleTitleA failed: %lu\n", GetLastError());
|
||||
|
||||
ret = GetConsoleOriginalTitleA(buf, ARRAY_SIZE(buf));
|
||||
todo_wine ok(ret, "GetConsoleOriginalTitleA failed: %lu\n", GetLastError());
|
||||
todo_wine ok(!strcmp(buf, title), "got %s, expected %s\n", wine_dbgstr_a(buf), wine_dbgstr_a(title));
|
||||
todo_wine ok(ret == title_len, "got %lu, expected %lu\n", ret, title_len);
|
||||
ok(ret, "GetConsoleOriginalTitleA failed: %lu\n", GetLastError());
|
||||
ok(!strcmp(buf, title), "got %s, expected %s\n", wine_dbgstr_a(buf), wine_dbgstr_a(title));
|
||||
ok(ret == title_len, "got %lu, expected %lu\n", ret, title_len);
|
||||
}
|
||||
|
||||
static void test_GetConsoleOriginalTitleW(void)
|
||||
|
|
|
@ -914,9 +914,17 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetConsoleMode( HANDLE handle, DWORD *mode )
|
|||
*/
|
||||
DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleOriginalTitleA( LPSTR title, DWORD size )
|
||||
{
|
||||
FIXME( ": (%p, %lu) stub!\n", title, size );
|
||||
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
|
||||
return 0;
|
||||
WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) );
|
||||
DWORD ret;
|
||||
|
||||
if (!ptr) return 0;
|
||||
|
||||
ret = GetConsoleOriginalTitleW( ptr, size );
|
||||
if (ret)
|
||||
WideCharToMultiByte( GetConsoleOutputCP(), 0, ptr, -1, title, size, NULL, NULL);
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, ptr );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue