From: Bernhard Übelacker bernhardu@mailbox.org
Currently the parent process returns a STATUS_CONTROL_C_EXIT instead of the child process. --- programs/timeout/tests/timeout.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/programs/timeout/tests/timeout.c b/programs/timeout/tests/timeout.c index bd99eb9e5e1..d6ee6c92357 100644 --- a/programs/timeout/tests/timeout.c +++ b/programs/timeout/tests/timeout.c @@ -136,9 +136,37 @@ static void test_ctrlc(void) run_timeout_ctrlc("/nobreak", 1); }
+static void test_ctrlc_intermediate(int argc, char** argv) +{ + char path_name[MAX_PATH]; + STARTUPINFOA startup; + PROCESS_INFORMATION info; + + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + sprintf(path_name, "%s %s %s", argv[0], argv[1], "ctrlc_intermediate"); + ok(CreateProcessA(NULL, path_name, NULL, NULL, FALSE, + CREATE_NEW_PROCESS_GROUP | CREATE_NEW_CONSOLE, + NULL, NULL, &startup, &info), + "CreateProcess failed.\n"); + wait_child_process(info.hProcess); + CloseHandle(info.hProcess); + CloseHandle(info.hThread); +} + START_TEST(timeout) { + int argc; + char** argv; BOOL ret; + + argc = winetest_get_mainargs(&argv); + if(argc == 3 && !strcmp(argv[2], "ctrlc_intermediate")) + { + test_ctrlc(); + return; + } + /* always run on a separate console, so that: * - we're sure to have a valid console input handle (no Wine unix console...) * - we can send ctrl-c events without interfering with parent (winetest...) @@ -158,5 +186,5 @@ START_TEST(timeout) }
test_basic(); - test_ctrlc(); + test_ctrlc_intermediate(argc, argv); }