Commit fdfd19cb authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

kernel32/tests: Make the console tests pass if current console is shell-no-window.

parent 7500fc1c
......@@ -1541,8 +1541,13 @@ static void test_Console(void)
startup.hStdOutput = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, &sa, OPEN_EXISTING, 0, 0);
/* first, we need to be sure we're attached to a console */
if (!is_console(startup.hStdInput) || !is_console(startup.hStdOutput))
if (startup.hStdInput == INVALID_HANDLE_VALUE || startup.hStdOutput == INVALID_HANDLE_VALUE)
{
/* this fails either when this test process is run detached from console
* (unlikely, as this very process must be explicitly created with detached flag),
* or is attached to a Wine's shell-no-window kind of console (if the later, detach from it)
*/
FreeConsole();
/* we're not attached to a console, let's do it */
AllocConsole();
startup.hStdInput = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, &sa, OPEN_EXISTING, 0, 0);
......
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