kernel32/tests: Make the console tests pass if current console is shell-no-window.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7500fc1ce9
commit
fdfd19cb47
|
@ -1541,8 +1541,13 @@ static void test_Console(void)
|
||||||
startup.hStdOutput = CreateFileA("CONOUT$", GENERIC_READ|GENERIC_WRITE, 0, &sa, OPEN_EXISTING, 0, 0);
|
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 */
|
/* 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 */
|
/* we're not attached to a console, let's do it */
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
startup.hStdInput = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, &sa, OPEN_EXISTING, 0, 0);
|
startup.hStdInput = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, &sa, OPEN_EXISTING, 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue