winetest: Make the wrapper immune to Ctrl-C.

This commit is contained in:
Ge van Geldorp 2009-01-17 00:21:20 +01:00 committed by Alexandre Julliard
parent 7f3439d556
commit 4de19cff1f

View file

@ -650,6 +650,16 @@ run_tests (char *logname)
return logname;
}
static BOOL WINAPI ctrl_handler(DWORD ctrl_type)
{
if (ctrl_type == CTRL_C_EVENT) {
printf("Ignoring Ctrl-C, use Ctrl-Break if you really want to terminate\n");
return TRUE;
}
return FALSE;
}
static void
usage (void)
{
@ -750,6 +760,8 @@ int main( int argc, char *argv[] )
if (!running_on_visible_desktop ())
report (R_FATAL, "Tests must be run on a visible desktop");
SetConsoleCtrlHandler(ctrl_handler, TRUE);
if (reset_env)
{
SetEnvironmentVariableA( "WINETEST_PLATFORM", running_under_wine () ? "wine" : "windows" );