Ge van Geldorp : winetest: Make the wrapper immune to Ctrl-C.

Alexandre Julliard julliard at winehq.org
Mon Jan 19 08:58:46 CST 2009


Module: wine
Branch: master
Commit: 4de19cff1f7a0fc5f46186e89d84955f35138db9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4de19cff1f7a0fc5f46186e89d84955f35138db9

Author: Ge van Geldorp <ge at gse.nl>
Date:   Sat Jan 17 00:21:20 2009 +0100

winetest: Make the wrapper immune to Ctrl-C.

---

 programs/winetest/main.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index a9ead7d..fc7a378 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -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" );




More information about the wine-cvs mailing list