GetStdHandle() still returns the pseudo handles for the closed console except they obviously don't work. So reset them to avoid confusion. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- testbot/src/testagentd/platform_windows.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testbot/src/testagentd/platform_windows.c b/testbot/src/testagentd/platform_windows.c index b3db635e1..ea6f03f80 100644 --- a/testbot/src/testagentd/platform_windows.c +++ b/testbot/src/testagentd/platform_windows.c @@ -689,6 +689,9 @@ void ta_freeaddrinfo(struct addrinfo *addresses) void platform_detach_console(void) { FreeConsole(); + SetStdHandle(STD_INPUT_HANDLE, INVALID_HANDLE_VALUE); + SetStdHandle(STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE); + SetStdHandle(STD_ERROR_HANDLE, INVALID_HANDLE_VALUE); } int platform_init(void) -- 2.20.1