Commit e4692b3f authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

kernel32/tests: Add more tests for WriteConsole.

parent 62901e6e
......@@ -780,6 +780,28 @@ static void testScreenBuffer(HANDLE hConOut)
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_HANDLE, GetLastError());
/* trying to write non-console handle */
SetLastError(0xdeadbeef);
ok(!WriteConsoleA(hFileOutRW, test_str1, lstrlenA(test_str1), &len, NULL),
"Shouldn't succeed\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_HANDLE, GetLastError());
SetLastError(0xdeadbeef);
ok(!WriteConsoleA(hFileOutRO, test_str1, lstrlenA(test_str1), &len, NULL),
"Shouldn't succeed\n");
ok(GetLastError() == ERROR_INVALID_HANDLE,
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_HANDLE, GetLastError());
SetLastError(0xdeadbeef);
ok(!WriteConsoleA(hFileOutWT, test_str1, lstrlenA(test_str1), &len, NULL),
"Shouldn't succeed\n");
todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE,
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_HANDLE, GetLastError());
CloseHandle(hFileOutRW);
CloseHandle(hFileOutRO);
CloseHandle(hFileOutWT);
......
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